How heitor-rocha/sistema-rotas-dijkstra works
This browser-based route planner models Viçosa-region roads as a weighted graph, lets users calculate and visualize shortest routes, and supports editing and saving custom networks. The main workflow is: choose cities, run Dijkstra’s algorithm, then display the exploration and route on the map. The graph editor, default regional dataset, and local persistence support that workflow. OSRM supplies road geometry and optional distance suggestions; OpenStreetMap supplies map tiles. The graph follows README documentation and excerpted calls; unsampled UI details are represented at the main-module level.
Main entry points: main.ts UI Orchestrator · Grafo.ts Weighted Graph · MapManager.ts Map Rendering · Dijkstra.ts Shortest-Path Search
Components 12
Application
- UI Orchestrator
src/main.ts - Network Editing
src/main.ts - Local Scenario Storage
src/main.ts
Routing Core
- Shortest-Path Search
src/core/Dijkstra.ts - Priority Queue
src/core/MinHeap.ts
Road Network
- Default Region Dataset
src/data/regiaoVicosa.ts - Weighted Graph
src/core/Grafo.ts
Map Services
- Map Rendering
src/ui/MapManager.ts
Other components
- Route Planner User
- OSRM Routing API
- OpenStreetMap Tiles
- Browser LocalStorage
Connections 17
- Route Planner User → UI Orchestrator: uses
README.md - UI Orchestrator → Default Region Dataset: loads defaults
src/main.ts - Default Region Dataset → Weighted Graph: populates
src/data/regiaoVicosa.ts - UI Orchestrator → Weighted Graph: manages network
src/main.ts - UI Orchestrator → Network Editing: handles edits
src/main.ts - Network Editing → Weighted Graph: updates
src/main.ts - UI Orchestrator → Shortest-Path Search: calculates route
src/main.ts - Shortest-Path Search → Weighted Graph: reads neighbors
src/core/Dijkstra.ts - Shortest-Path Search → Priority Queue: queues candidates
src/core/Dijkstra.ts - UI Orchestrator → Map Rendering: animates exploration
src/main.ts - Map Rendering → Weighted Graph: reads roads
src/ui/MapManager.ts - UI Orchestrator → Local Scenario Storage: saves and restores
src/main.ts - Local Scenario Storage → Weighted Graph: serializes state
src/main.ts - Local Scenario Storage → Browser LocalStorage: reads and writes
src/main.ts - Map Rendering → OSRM Routing API: fetches geometry
src/ui/MapManager.ts - Map Rendering → OpenStreetMap Tiles: loads tiles
src/ui/MapManager.ts - UI Orchestrator → OSRM Routing API: suggests distance
src/main.ts