https://github.com/deenuy/dijkstra-algo-shortest-path
Dijkstra's Algorithm for finding shortest path between two cities using PriorityQueues and list nearby cities for given distance k.
https://github.com/deenuy/dijkstra-algo-shortest-path
data-structures-and-algorithms graph-theory java priority-queues
Last synced: 8 months ago
JSON representation
Dijkstra's Algorithm for finding shortest path between two cities using PriorityQueues and list nearby cities for given distance k.
- Host: GitHub
- URL: https://github.com/deenuy/dijkstra-algo-shortest-path
- Owner: deenuy
- Created: 2022-04-30T03:34:52.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-30T05:26:58.000Z (about 4 years ago)
- Last Synced: 2025-06-04T04:26:25.119Z (about 1 year ago)
- Topics: data-structures-and-algorithms, graph-theory, java, priority-queues
- Language: Java
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dijkstra-algo-shortest-path
Dijkstra's Algorithm for finding shortest path between two cities using PriorityQueues and list nearby cities for given distance k. Assumes all distances are non-negative.
Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of vertices (also called nodes or points) which are connected by edges (also called links or lines).
## Implementations of graph algorithms:
- Read CSV and create graph with vertices/ nodes and edges using HashMap>
- Add static method, shortestPath(Graph graph, String from, String to), returning a List of cities visited, from source to the destination, followed by total distance between cities (km)
- Add static method, nearby(Graph graph, String origin, double distance), returning a List of cities with the corresponding distances, for given distance (eg: k=100)
Input file is provided in CSV format, based on Ontario map, listing cities and distances.
### Citations for code adoption:
- Sedgewick, R., Wayne, K. (2011). Algorithms, 4th Edition. Addison-Wesley. ISBN: 978-0-321-57351-3
- Goodrich, M. T., Tamassia, R. (2014). Data Structures and Algorithms in Java, 6th Edition. John Wiley & Sons. ISBN: 0-471-38367-8