Skip to content

Reda-Muhamed/Map-Routing-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— Fastest Path Routing System

Overview

This project implements a high-performance routing system that finds the fastest path (least time) between any two points on a map. Unlike standard algorithms that work from node to node, this system supports arbitrary source and destination coordinates, allowing users to walk to and from nearby intersections within a specified range.


Table of Content


Project Structure

-ShortestPathFinder.MapRouting/ β”‚ β”œβ”€β”€ Engine/
β”‚ β”œβ”€β”€ Graph.cs
β”‚ β”œβ”€β”€ OptimalAlgorithm.cs
β”‚ └── PathBuilder.cs
β”‚ β”œβ”€β”€ Handler/
β”‚ └── HandleWalkingDistance.cs β”‚ β”œβ”€β”€ Models/
β”‚ β”œβ”€β”€ Edge.cs
β”‚ β”œβ”€β”€ Node.cs
β”‚ └── Query.cs
β”‚ β”œβ”€β”€ Utilities/
β”‚ β”œβ”€β”€ HelperFunctions.cs
β”‚ β”œβ”€β”€ InputReader.cs
β”‚ └── TimeHandler.cs
β”‚ β”œβ”€β”€ TestCases/
β”‚ β”œβ”€β”€ Large Cases/
β”‚ β”œβ”€β”€ Medium Cases/
β”‚ └── Sample Cases/
β”œβ”€β”€ myOutput/ β”‚ └── results.txt
β”‚ β”œβ”€β”€ Program.cs
└── README.md


Features

  • Source and destination points can be any coordinates, not just graph nodes.
  • Walking allowed within a radius R (in meters) from source/destination to nearest intersection.
  • Road network modeled with nodes and edges, each edge has a length and speed.
  • Output includes:
    • Path nodes from source to destination.
    • Total travel time (minutes).
    • Distance walked and distance driven.
    • Execution time (logic only and with I/O).
  • Optimized for large graphs:
    • Up to 200,000 nodes
    • Up to 250,000 edges
    • Up to 1,000 queries

Input Format

map.txt

<node_id> ... <from_node> <to_node> <length_km> <speed_kmph> ... ```

###queries.txt <source_x> <source_y> <destination_x> <destination_y> <max_walking_distance_in_meters> ... πŸ’‘ Algorithms Used Dijkstra’s algorithm (optimized with a priority queue) for shortest-time path.

Euclidean distance calculation for identifying reachable nodes within walking distance.

Performance monitoring using C#’s Stopwatch for execution time.


Sample Output

pgsql Copy Edit The path nodes: 0, 3, 4, 5, 2 Shortest time = 4.63 mins Path length = 1.72 km Walking distance = 0.28 km Vehicle distance = 1.44 km Execution time (no I/O) = 1 ms Execution time (with I/O) = 5 ms πŸ›  Technologies Language: C# (.NET)

Design: Object-Oriented Programming (OOP)

Data Structures: Graphs, Priority Queue, Geometry


Contributors

Name Github Link
Reda Mohamed Reda Mohamed https://github.com/Reda-Muhamed
Tasneem Mohamed Ahmed Mohamed https://github.com/Tasneem357Mohamed
Bsmala Tarek Kamal Khalil Elbagoury https://github.com/Bsmalatarek
Yara Ahmed Abdelrahman
Yassmina Mohamed Saleh https://github.com/Yassmina2106

About

This project is a map-based routing system designed to find the fastest path (in time) between a source and a destination point. The map is modeled as a graph, where intersections are nodes and roads are edges with defined lengths and speed limits.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages