Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FlightRouteOptimizer

✈ Flight Route Optimization

Flight Route Optimization is a web application built using Data Structures and Algorithms (DSA). The project helps users find the best flight route between Indian airports based on different preferences like lowest cost, fastest travel time, minimum stops, shortest distance, and balanced route.

The project also shows the selected route visually on a real-time interactive map.


πŸ“Œ Introduction

Nowadays, people travel between cities using flights very frequently. While booking flights, different users may have different needs.

For example:

  • Some users want the cheapest ticket.
  • Some users want the fastest journey.
  • Some users want fewer layovers.
  • Some users want the shortest travel distance.

Finding the best route manually becomes difficult when there are many airports and multiple flight connections.

This project solves that problem using graph algorithms.

In this project:

  • Airports are treated as nodes.

  • Flight routes are treated as edges.

  • Each route contains:

    • Cost
    • Time
    • Distance

The system calculates optimized routes automatically and displays them to the user.


❗ Problem Statement

Flight networks are large and complex. One airport can connect to many other airports, and each route may have:

  • Different ticket prices
  • Different travel times
  • Different layovers
  • Different distances

Example:

A user wants to travel from:

Hyderabad β†’ Delhi

Possible routes:

HYD β†’ DEL

or

HYD β†’ BOM β†’ DEL

or

HYD β†’ BLR β†’ DEL

Each route has different:

  • Cost
  • Time
  • Distance

The challenge is to automatically find the best route according to user preference.


πŸ’‘ Solution Idea

The project uses graph-based algorithms to solve the routing problem.

Graph Representation

  • Airports β†’ Nodes
  • Routes β†’ Edges

Example:

{
    from: "HYD",
    to: "DEL",
    cost: 7800,
    time: 165,
    distance: 1500
}

This means:

Hyderabad β†’ Delhi
Cost = β‚Ή7800
Time = 165 mins
Distance = 1500 km

The project creates a graph from all airports and routes.


βš™ How the Project Works

Step 1 β€” User Selects Airports

The user selects:

  • From Airport
  • To Airport
  • Optimization Preference

Example:

FROM: Hyderabad
TO: Delhi
PREFERENCE: Cheapest Route

Step 2 β€” Graph Creation

The system creates a graph using all airports and routes.

Example:

HYD β†’ BOM
HYD β†’ BLR
BOM β†’ DEL
BLR β†’ DEL

Step 3 β€” Algorithm Runs

Different algorithms are used for different preferences.


🧠 Algorithms Used

1. Cheapest Route β€” Dijkstra Algorithm

This algorithm finds the route with minimum total ticket cost.

Example:

HYD β†’ BOM β†’ DEL

Cost:

β‚Ή5300

Instead of direct:

HYD β†’ DEL = β‚Ή7800

So the cheaper route is selected.


2. Fastest Route β€” Dijkstra Algorithm

This algorithm finds the route with minimum travel time.

Example:

HYD β†’ DEL

Time:

165 mins

Even if cost is higher, the fastest route is selected.


3. Minimum Stops β€” BFS Algorithm

This algorithm finds the route with the fewest layovers.

Example:

HYD β†’ DEL

Stops:

0 Stops

Instead of:

HYD β†’ BOM β†’ DEL

which has:

1 Stop

4. Shortest Distance β€” Dijkstra Algorithm

This algorithm finds the route with minimum total distance.

Example:

HYD β†’ DEL

Distance:

1500 km

5. Balanced Route β€” Weighted Dijkstra

This route balances:

  • Cost
  • Time
  • Distance

It gives a route that is overall efficient.

Example:

Medium cost
Medium time
Medium distance

instead of only optimizing one factor.


πŸ—Ί Map Visualization

The project also visualizes routes on an interactive map.

The system uses:

  • Latitude
  • Longitude

of airports.

Example:

{
    code: "HYD",
    lat: 17.2403,
    lng: 78.4294
}

When a route is selected:

HYD β†’ BOM β†’ DEL

the map:

  • Places airport markers
  • Draws route lines
  • Zooms automatically

This gives a real flight route experience.


πŸ“Š Route Information Displayed

The system displays:

  • Total Cost
  • Total Time
  • Total Distance
  • Number of Layovers
  • Alternative Routes

Example:

Total Cost: β‚Ή5300
Total Time: 210 mins
Distance: 1770 km
Stops: 1

πŸ›  Technologies Used

  • HTML
  • CSS
  • JavaScript
  • Leaflet.js
  • OpenStreetMap

🌟 Features

  • 50+ Indian Airports
  • Real-time Route Optimization
  • Interactive Flight Map
  • Cheapest Route Finder
  • Fastest Route Finder
  • Minimum Stops Detection
  • Balanced Route Recommendation
  • Alternative Route Cards
  • Responsive Design
  • Dynamic UI Updates

πŸ“Έ Project Screenshots

Home Page

Home Page


Route Optimization Result

Route Optimization


Interactive Route Map

Map


β–Ά How to Run the Project

  1. Clone the repository:
git clone <https://github.com/harshavardhanBOMMALATA/FlightRouteOptimizer.git>
  1. Open the project folder:
cd FlightRouteOptimization
  1. Open the folder in VS Code.

  2. Install the Live Server extension in VS Code.

  3. Right click on:

index.html

and select:

Open with Live Server
  1. The project will open automatically in your browser.

🎯 Conclusion

Flight Route Optimization shows how DSA and graph algorithms can solve real-world travel problems.

The project demonstrates:

  • Graph Representation
  • Dijkstra Algorithm
  • BFS Algorithm
  • Route Optimization
  • Interactive Visualization

It combines algorithms with frontend development to create a practical and user-friendly flight optimization system.


πŸ‘¨β€πŸ’» Developed By

Harshavardhan

About

Flight Route Optimization is a DSA-based web application that finds the cheapest, fastest, shortest-distance, and minimum-stop routes between Indian airports using graph algorithms like Dijkstra and BFS. It also visualizes optimized flight paths on an interactive real-time map with dynamic statistics.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages