Skip to content

Path Panda is an intelligent travel optimization platform that helps users find the most affordable and convenient routes between two cities. If you're looking to minimize travel cost and travel via multi transportation modes (train or bus), Path Panda delivers data-driven suggestions to make planning easyy.

License

Notifications You must be signed in to change notification settings

prateekshukla17/Path-Panda

Repository files navigation

Path Panda

Path Panda is a smart routing engine designed to calculate the cheapest (and eventually fastest) way to travel between any two Indian cities. It takes into account multiple transportation modes such as trains and buses, and uses an algorithmic approach to determine the optimal route.

Overview of the Application

Overview

Architecture of the Application

Architecture

Path-Panda is structured into three Components:

1. Data Pipeline

  • This is the backend service responsible for fetching all transport-related data from external APIs and organizing it for storage and computation.
  • IRCTC TRAIN DATA: From RapidAPI
  • BUS ROUTES: Are webscraped and hardCoded

1.0 Data Pipeline Sample

SampleDataPipeline

  • Note: getTrains endPoint doesnt fetchs fare details, thats why another getFare endpoint is used to fetch fares for every train.

✅ Responsibility: Pull data, compute minimum fares, and push structured city-pair data into the database.

2. Database(MongoDB)

This component stores all fare information between city pairs in a clean and searchable format. Example entries:

1.0 Database Schema and Sample Data

SampleDBData

✅ Responsibility: Act as a persistent graph representation where each document corresponds to a direct route between two cities with its fare and transport mode.

3. Modified Dijkstra Algorithim

This is the heart of Path-Panda. It reads data from the MongoDB database and creates a graph structure where: Nodes = Cities Edges = Direct routes (bus/train) with weights = fare

  • Then it applies a modified Dijkstra’s Algorithm to find the cheapest path from the source to destination, considering multiple transport modes.

3.1 Working of Modified Dijkstra to accomadate Mutiple Modes of Travel

we model each city as two nodes:

Example: Kanpur_Train and Kanpur_Bus

🔁 Mode Switch Each city has a zero or low-cost edge between its _Train and _Bus nodes to allow mode switching (e.g., Delhi_Train ↔ Delhi_Bus).

🗺️ Graph Construction

  • Nodes: City_Mode (e.g., Delhi_Bus)
  • Edges: Travel routes with fare as weight (from database)
  • We run a modified Dijkstra’s algorithm:
  • Start from both Source_Train and Source_Bus
  • Explore cheapest path using fares as weights
  • Switch modes when needed
  • Stop at Destination_Train or Destination_Bus

A Sample Path:

SampleGraph

✅ Responsibility: Calculate the optimal (cheapest) path across different modes from point A to point B.

Current Limitations & Future Improvements

  • Scalability-Ready: The system is designed to scale, but due to limited API access, it's currently restricted to a set of pre-defined routes.

  • Dynamic Junction Discovery: Work is in progress to automate key stopovers between major cities, enhancing route accuracy and flexibility.

  • Bus Data Automation: The data pipeline is being improved to automatically fetch and update bus routes and fares via a REST API.

  • Flight Integration: Flight routes and pricing will be supported in upcoming updates, enabling true multimodal travel planning.

About

Path Panda is an intelligent travel optimization platform that helps users find the most affordable and convenient routes between two cities. If you're looking to minimize travel cost and travel via multi transportation modes (train or bus), Path Panda delivers data-driven suggestions to make planning easyy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published