Airlines routinely change their flight schedules for various reasons like seasonal demands, picking new routes, time changes needed based on daylight savings, changes to flight numbers, operating frequency, timings, etc. Many passengers get impacted due to these schedule changes and they need to be regularly re-accommodated to alternate flights.
The project uses a advanced and robust Hybrid Classical-Quantum Solution to identify optimal alternate flight solutions for all impacted passengers based on certain constraints and considering various factors like PNR priority, time to reach the destination, and special passenger types without jeopardizing the flight experience for the passengers.
We have provided a GUI, deployed using Streamlit
to provide flexibility and easily modify the ruleset containing various scores for each attribute used to calculate PNR scores, flight grades, class allocation, etc.
Make sure that you have Python 3.10
installed in your system
Run the following command in the terminal
pip install -r requirements.txt
Make a file named .env
in the main folder, it's content should be: (It has already been made in this case though)
GMAPS_API_KEY=your_key
DWAVE_TOKEN=your_token
flight_mail=your_mail
flight_mail_password=your_password
GMAPS_API_KEY
can be obtained from the First Distancematrix accurate application
API of Distance Matrix
DWAVE_TOKEN
can be obtained from here
Now, to run the script enter the following command in the terminal inside the folder where this folder is downloaded
streamlit run Landing_Page.py
(if it doesn't work then):
python3 -m streamlit run Landing_Page.py
(if it doesn't work then):
python -m streamlit run Landing_Page.py
- Go to PNR Ranking Score tab in the Streamlit webapp and choose the dataset u want. The number in bracket indicates the number of Impacted PNRs.
- Change the values if needed using slider and click Proceed (IMPORTANT)
- Go to the Next page Cabins and Classes and do the same. Click Proceed when done.
- Go to the next page flight quality score and do the same. Click Proceed.
- Please note that you will have to click on Rerun. located at top right section everytime you click Proceed.
- Then come to Landing Page and click Run Code. You can disable and enable accordingly if u need different city pairs or not.
- Go to Solution 1 , Solution 2, Solution 3 and Different City Pairs to see the different solution files.
- Click on Statistics to view the statistics.
result_quantum_0.json
,result_quantum_1.json
,result_quantum_2.json
are the different solution files with same city pairsexception_list_0.json
,exception_list_1.json
,exception_list_2.json
are the different solution files with different city pairsnon_assignments_0.txt
,non_assignments_1.txt
,non_assignments_2.txt
are the 3 non assigned list of PNRs corresponding to the 3 solutions.
Note: These have been provided with the code for example inside Example-soln-files
. However, on running, they are generated according to the dataset used in the parent folder.
Each file contains widgets to adjust various parameters along with some default values.There is also a button indicating wheather we want to allow flights to adjacent city pairs in main page. On pressing the proceed button at the bottom of each page, all the values chosen are written into a python file as variables which can be imported for use in other programs.
- Used to generate different solution files and send email to the passengers.
- Option to add different city pair solution
- Used to modify scores for PNR priority calculation parameters like PAX, loyalty, classes, MCT, MAXCT, ETD, etc
- writes to constants.py
- Used to allow/disallow class changes during flight allocation and upgrade/downgrade rules
- writes to classRules.py
- Used to modify parameters used to rank the flight and allocate grades like arrival delay, STD and citypairs
- writes to flightScores.py
- Used to display PNR wise re-accomodation solution
- displays only after generating solution files
Following this, we have 2 more pages corresponding to the other two solutions.
- Used to display various plots which helps compare different solutions by our model.
- displays only after generating solution files
- Gautam Sharma
- Sreehari Chandran
- Dhanesh Vijay
- Shivam Garg
- Aryan Lath
- Shivam Agrawal
- Ayush Savar
- Ayush Kumar
- Rahul Mareja
- Saundarya Keshari