An app for creating and traversing through maps using graph datastructure.
Git
Guide to Git Installing GitPython 3.5 or higher
Pip
Guide to installing pipPipenv
Pipenv documentation
- After installing the
prerequisites
above, clone the repository Develop branch using this commandgit clone -b develop https://github.com/ja-odur/map.git
- Change into the newly cloned repo through
cd map
- Using pipenv, start the environment and install requirements
- $
pipenv shell
- $
pipenv install
. That didn't work, trypipenv install --skip-lock
- Import the Map class
from map import Map
- Instantiate the Map class
graph = Map(['place1', 'place2', 'place3'])
- Add edges between any of the places
graph.add_edge('place1', 'place3')
- Find the shortest path between two places
graph.shortest_path('place1', 'place3')
- Topologically sort DAG (Directed Acyclic Graphs)
graph.topological_sort()
- Establish the minimum spanning tree
graph.minimum_spanning_tree()