Skip to content

Python script for getting shortest path in the board game "Ticket to ride" given any amount of goals.

License

Notifications You must be signed in to change notification settings

JLMadsen/ShortestTTR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShortestTTR

Python script for getting shortest path connecting all given goals in the board game "Ticket to ride".

Usage

Format:

./ShortestTTR.py map goal1 goal2 goal3 goal4

Playing on the Europe map and having the goals Sochi, Edinburgh, Stockholm, and Cadiz:

./ShortestTTR.py Europe Sochi Edinburgh Stockholm Cadiz

This will print the path, cost and visualize the path.

path: ['Cadiz', 'Madrid', 'Pamplona', 'Paris', 'Dieppe', 'London', 'Edinburgh', 'London', 'Amsterdam', 'Essen', 'Kobenhavn', 'Stockholm', 'Petrograd', 'Moskva', 'Kharkov', 'Rostov', 'Sochi']
cost: 52

Libraries used

  • NetworkX
  • Matplotlib
  • OpenCV
  • PyDot

Ticket to ride

https://en.wikipedia.org/wiki/Ticket_to_Ride_(board_game)

About

Python script for getting shortest path in the board game "Ticket to ride" given any amount of goals.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages