Analyzing the board game Ticket to Ride as an undirected graph for various problems

Analyzing the board game Ticket to Ride as an undirected graph.

Run via `cargo run`

.

Data is included in the mattgawarecki-ticket-to-ride folder. This data was pulled from https://data.world/mattgawarecki/ticket-to-ride under the terms of the MIT license.

Determines the most efficient tickets by creating a ratio of the number of trains required to complete the ticket to the number of points earned from completing the ticket. A lower number is better, as less trains are required to earn a point. For example:

- Vancouver to Montreal requires 20 trains to earn 20 points from the ticket, and the distance to points ratio is 1, as 1 train earns 1 point.
- Seattle to New York requires 20 trains to earn 22 points, and the distance to points ratio is .909, as 20 trains are used to earn 22 points
- Winnipeg to Houston requires 15 trains to earn 12 points, and the distance to points ratio is 1.25, as 15 trains are used to earn 12 points

While some inconsistencies exist, most tickets have a 1:1 ratio. It may be advantageous to exploit some of these differences, but the difference in points may also be due to factors not currently accounted for in this analysis, such as length of routes used to complete the ticket, routes with more than one path, and the likelihood that a ticket will be closed off, ex. single point of failure vs. tickets with multiple workarounds.

This is the default implementation of the library, and can be run via

```
cargo run
```

View how individual modules work. Args can be combined.

```
./target/debug/ticket-to-ride --route
./target/debug/ticket-to-ride --ticket
./target/debug/ticket-to-ride --matrix
./target/debug/ticket-to-ride --graph
```

I’m considering this repository done for the most part, as an accurate analysis of the most efficient routes would need to consider various other factors that would require exponentially more work. I’ve accomplished what I set out to do, which was:

- Get more experience with Rust
- Implement graph structures in Rust
- Apply graph structures to the board game Ticket to Ride
- Implement BFS, DFS, and Dijkstra’s algorithm
- DFS not included; partially implented, and then abandoned as it was not helpful to the overall end goal of analyzing most efficient routes

- Create a simple yet useful efficiency analysis on available Ticket to Ride tickets

Ideas for future expansion are presented below but should not be expected to be implemented.

- Consider length of routes required for a ticket and not just number of trains required to build
- Consider additional points from building trains in addition to completing the ticket
- Consider the effect of routes that can be completed with more than 1 color

Find the routes with the best point value per difficulty.

- Calculate difficulty of all routes on a ratio of 1-10
- This is a more difficult problem because will need to consider colored vs. grey routes as well as routes with double tracks
- May also want to consider number of viable paths

- Find ratio of difficulty per points, not considering paths to routes or points gained from building route

Many complexities of rust memory management have been worked around via the `.clone()`

function. While this may be acceptable, and even preferable, in some of its uses in this project, there are likely opportunities to reduce its usasge and write more performant and idiomatic Rust code while still maintaining functionality.

- Contributors to the following StackOverflow questions: