Skip to content

paulmz1/python_examples

Repository files navigation

Python Examples

Traveling Salesman Problems

ORTools

google_ortools/tube_stations.py - Uses Google's ortools lib to solve the shortest path between London Underground train stations from Openstreetmap. The results are plotted onto a map of London using Plotly.

Tube Stations

Dash

dash/traveling_salesman.py - Using Dash for the realtime visualisation of the Traveling Salesman Problem being solved using brute force.

Dash

NetworkX Held Karp

tsp/traveling_salesman.py - Visualisation using Networkx of an asymmetric Traveling Salesman Problem solved using the Held–Karp algorithm. See tsp/solvers/tsp_held_karp.py

NetworkX Held Karp

Notes

Tested on Python 3.7 64 bit. At the time of testing, ORTools wasn't available for some versions of Python 3 or 32 bit versions.

Dependencies

ortools dash networkx numpy plotly matplotlib pandas geopy

Requirements.txt generated with> pipreqs --force