- Graph Implementation: Custom C++ graph class
graph.husing an adjacency list. Supports directed, weighted edges and self-loops. - JSON Data Parsing: Reads pre-processed OpenStreetMap data (buildings, waypoints, footways) from JSON files using a C++ JSON library.
- Graph Construction: Builds the map graph, representing footways as undirected edges and connecting buildings to nearby path nodes.
- Dijkstra's Shortest Path: Implements Dijkstra's algorithm to find the shortest path, excluding intermediate buildings. Uses C++
priority_queue. - Text Interface: A command-line application
main.cppto find and display paths between buildings. - Web Interface: A local web server
server.cppusinghttplib.hto visualize shortest paths graphically.
- Make: Build automation tool.
- Third-party C++ JSON Library: User's choice of a header-only library for parsing map data.
- httplib.h: C++ header-only library for the web server interface.
- OpenStreetMap Data: Base map data, pre-processed into JSON.
- Clone/Download: Git clone.
- Add JSON Library: Place the chosen C++ JSON library header file(s) in the project's root directory.
- Build Executables using Make:
- Build tests:
make osm_tests
- Build text interface:
make osm_main
- Build web server:
make osm_server
- Build tests:
Once you are done, you can run make run_server to run a C++ web server that will display the graphical output of the shortest path between two buildings, using our downloaded OpenStreetMaps data.
make test_all # Run all tests
make test_graph # Run only graph implementation tests
make test_build_graph # Run only graph building tests
make test_dijkstra # Run only Dijkstra algorithm tests