Coder Social home page Coder Social logo

airline-reservation-c-code-open-ended-project-'s Introduction

AIRLINE-RESERVATION

ABOUT:

In Airline reservation system, Passengers generally has two prefrences while booking flight tickets. Sometimes it become difficult to find the flight which is cost efficient or time efficient. Our project is based on this, here we give two options one for cost efficient and second for time efficient. Passengers can choose anyone of them and can book flight tickets.The program will show the shortest path between source and destination city according to the prefrence the user choose. First there will be 3 options:

1.Cities we travel. 2.Book your flight. 3.Print your ticket.

Here passengers can search for the flight as per their requirements and book the flight. Then there will be an option to print the ticket, they can print it easily.

TECHNIQUE:

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. So the problems where choosing locally optimal also leads to global solution are best fit for Greedy. A greedy algorithm is an algorithmic strategy that makes the best optimal choice at each small stage with the goal of this eventually leading to a globally optimum solution. This means that the algorithm picks the best solution at the moment without regard for consequences.

ALGORITHM:

Here we maintain two graphs, one graph contains vertices as cities and their weight represent the flight cost from the two vertices and the other graph contain the cities as vertices in which weight represents the duration of flight. We used dijkstra algorithm for both the cost adjacency matrix and the time adjacency matrix.As the dijkstra algorithm is single source all vertices algorithm, but we changed it to a single source and single destination algorithm.

Algorithm Dijkstra(G,s) //Dijkstra's algorithm for single source shortest paths. //Input: A weighted connected graph G = (V,E) and its vertex s. //Output: The length d, of a shortest path from s to v and its penultimate vertex Pv for every //vertex v in V initialise(Q) for every vertex v in V do

dv <- ∞; Pv <- null Invert(Q,v,dv) dv<-0: Vt <-Φ for i<-0 to [V]-1 do U*<-DeleteMin(Q) Vt <-Vt U [a*] for every vertex u in V- Vt that is adjacent to U* do if du* + w(u*,u) <du du <- du*+ w(u*,u); Pu <- u* Decrease(Q,u,du)

TIME COMPLEXITY:

The main advantage of Dijkstra’s algorithm is its considerably low complexity, which is almost linear. However, when working with negative weights, Dijkstra’s algorithm can’t be used.Also, when working with dense graphs, where is close to , if we need to calculate the shortest path between any pair of nodes, using Dijkstra’s algorithm is not a good option. The reason for this is that Dijkstra’s time complexity is . Since equals almost , the complexity becomes . When we need to calculate the shortest path between every pair of nodes, we’ll need to call Dijkstra’s algorithm, starting from each node inside the graph. Therefore, the total complexity will become . • The time efficiency of Dijkstra’s depends on the data structures representing an input graph. • It is in θ(|V | 2 ) for graphs represented by their weight matrix.

airline-reservation-c-code-open-ended-project-'s People

Contributors

mehulbhardwaj1609 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.