Skip to content

A mapping application with the ability to provide and visualize routes from one point to another in a map using Google Maps API.

License

Notifications You must be signed in to change notification settings

jitendrabhamare/UCSDGraphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Route Planning with Graph Algorithms

Java License: MIT Coursera

Route Planning with Graph Algorithms is a Java-based mapping application that calculates and visualizes routes between geographic points using classical graph algorithms. Built as part of UCSD’s Advanced Data Structures in Java course on Coursera, this project demonstrates real-world graph theory applications via an interactive map interface powered by the Google Maps API.


Table of Contents


Features

  • Compute shortest paths using Breadth-First Search (BFS), Dijkstra’s Algorithm, and A* Search
  • Interactive route visualization on Google Maps
  • Real-world road data integration with Java and JavaFX frontend

About the Project

This project emphasizes algorithmic problem-solving through route planning, integrating backend graph logic with a frontend Google Maps interface. It’s a simplified but educational alternative to commercial mapping systems, focusing on algorithm design over production-grade UX.

Learning Objectives

  • Implement graph structures and traversal algorithms from scratch in Java
  • Understand trade-offs between different shortest path algorithms
  • Visualize algorithm performance and pathfinding behavior in real geographic contexts

Getting Started

Prerequisites

  • Java 8 or higherDownload here
  • Maven – Dependency and build manager (Install guide)
  • Google Maps API Key – Get one here
  • Eclipse IDE (optional) – or use any Java IDE of your choice

Installation

  1. Clone the repository

    git clone https://github.com/jitendrabhamare/UCSDGraphs.git
  2. Navigate to the project directory

    cd UCSDGraphs
  3. Set your Google Maps API key

    Create the following file if it doesn't exist:

    # File: src/main/resources/config.properties
    google.maps.api.key=YOUR_API_KEY
  4. Build the project

    mvn clean install

Running the Application

  1. Launch the JavaFX application:

    java -jar target/UCSDGraphs-1.0-SNAPSHOT.jar
  2. Open http://localhost:8080 in your browser to interact with the map interface.


Implementation Highlights

1. Graph Structure & Node Design

Custom MapGraph class represents the map:

  • Nodes: GeographicPoint intersections
  • Edges: directed, weighted road segments

🔍 Demo: Visualizing loaded intersections on the map


2. Breadth-First Search (BFS)

BFS is used for unweighted shortest path discovery.

  • Time Complexity: O(V + E)
  • Space Complexity: O(V)
  • Optimal: Yes, for unweighted graphs
  • Use Case: Scenarios where edge weights are irrelevant (e.g., basic pathfinding, board games)

🧭 Demo: BFS explores shortest unweighted path


3. Dijkstra’s Algorithm

Dijkstra computes shortest paths on weighted graphs with non-negative edge costs.

  • Time Complexity: O((V + E) log V) with priority queue
  • Space Complexity: O(V)
  • Optimal: Yes
  • Use Case: GPS routing where travel distances or times differ across roads

🛣️ Demo: Dijkstra’s algorithm finds optimal weighted paths


4. A* Search

A* uses heuristics to prioritize promising paths, reducing unnecessary exploration.

  • Time Complexity: O((V + E) log V) (average case)
  • Space Complexity: O(V)
  • Optimal: Yes, with admissible heuristics (e.g., straight-line distance)
  • Use Case: Real-time routing with performance constraints (e.g., robotics, games)

🧠 Demo: A efficiently finds optimal route using heuristics*


Source Code Overview

Core Graph Logic

Utilities & Data Models


Contributing

Contributions are welcome! To contribute:

  1. Fork this repository
  2. Create a new branch:
    git checkout -b feature/your-feature-name
  3. Commit and push your changes
  4. Open a pull request with a detailed description

Credits

  • Course & Starter Code: UCSD MOOC Team
    (Mia Minnes, Christine Alvarado, Leo Porter, Alec Brickner, Adam Setters)
  • Project Implementation: Jitendra Bhamare

License

Licensed under the MIT License. See the LICENSE file for full details.


Support

For questions or issues, feel free to open an issue or contact via email:
📧 jitendra@email.com

About

A mapping application with the ability to provide and visualize routes from one point to another in a map using Google Maps API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages