Skip to content

Map a graph of the roads & intersections of a dataset, calculate shortest path, and the minimum spanning tree

Notifications You must be signed in to change notification settings

mustafa-siddiqui/street-mapping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Street-Mapping

Overview

The program reads an input file containing information about intersections and roads for an area. It maps a scalable, resizable graph using the Java Graphics Library, computes the shortest path between two intersections (nodes/vertices) provided by the user using Dijkstra's algorithm and plots in on the map, and computes the minimum spanning tree of a graph using Kruskal's algorithm (the implementation is computationally inefficient for very large datasets due to lack of O(1) data retrieval times for sets.

Performance

Tested with three files (also in the repo) in increasing order of information:

  • ur.txt (~300 vertices and edges combined)
  • monroe.txt (~150,000 vertices and edges combined)
  • nys.txt (>1,000,000 vertices and edges combined)

Shortest Path Runtimes (Macbook Pro with Intel i5)

  • ur.txt: <1 sec
  • monroe.txt: ~1 sec
  • nys.txt: <2 sec

Compilation

To compile, navigate to the directory containing the code source files and type:

javac Main.java
java Main [file_name] [-show] [-directions startIntersection endIntersection] [-meridianmap]

Flags (can be used in combination with one another):
-show: to graph the map of the data
-directions startIntersection endIntersection: compute shortest path between two intersections
-meridianmap: compute the minimum spanning tree

** need to have at least one optional flag to run.

Results

Shortest Paths

UoR Campus

ur.txt

Monroe County in NY State

monroe.txt

NY State

nys.txt

Minimum Spanning Tree

kruskal

About

Map a graph of the roads & intersections of a dataset, calculate shortest path, and the minimum spanning tree

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages