Flight connections- linear programming

4 Ansichten (letzte 30 Tage)
Martin Hercko
Martin Hercko am 3 Mai 2019
Bearbeitet: Martin Hercko am 3 Mai 2019
Hello everyone,
I have started using MATLAB just recently and i have problem solving this problem. Does anyone have an idea, how to solve this linear programming problem? I would be really grateful for any help. Thank you in advance.
FLIGHT CONNECTIONS AT A HUB
The airline SafeFlight uses the airport Roissy-Charles-de-Gaulle as a hub to minimize the number of flight connections to European destinations. Six Fokker 100 airplanes of this airline from Bordeaux, Clermont-Ferrand, Marseille, Nantes, Nice, and Toulouse are landing between 11am and 12:30pm. These aircraft leave fo Berlin, Bern, Brussels, London, Rome, and Vienna between 12:30 pm and 13:30 pm. The numbers of passengers transferring from the incoming flights to one of the outgoing flights are listed in the table below.
Numbers of passengers transferring between the different flights
+----------------+---------------------------------------+
|Origins | Destinations |
| +------+----+--------+------+----+------+
| |Berlin|Bern|Brussels|London|Rome|Vienna|
+----------------+------+----+--------+------+----+------+
|Bordeaux | 35 | 12 | 16 | 38 | 5 | 2 |
|Clermont-Ferrand| 25 | 8 | 9 | 24 | 6 | 8 |
|Marseille | 12 | 8 | 11 | 27 | 3 | 2 |
|Nantes | 38 | 15 | 14 | 30 | 2 | 9 |
|Nice | - | 9 | 8 | 25 | 10 | 5 |
|Toulouse | - | - | - | 14 | 6 | 7 |
+----------------+------+----+--------+------+----+------+
For example, if the flight incoming from Bordeaux continues on to Berlin, 35 passengers and their luggage may stay on board during the stop at Paris. The flight from Nice arrives too late to be re-used on the connection to Berlin, the same is true for the flight from Toulouse that cannot be used for the destinations Berlin, Bern and Brussels (the corresponding entries in the table are marked with -). How should the arriving planes be re-used for the departing flights to minimize the number of passengers who have to change planes at Roissy?
Source code used in Fico Xpress Ive if it is of any help.
model "F-1 Flight connections"
uses "mmxprs"
declarations
PLANES = 1..6 ! Set of airplanes
PASS: array(PLANES,PLANES) of integer ! Passengers with flight connections
cont: array(PLANES,PLANES) of mpvar ! 1 if flight i continues to j
end-declarations
initializations from 'f1connect.dat'
PASS
end-initializations
! Objective: number of passengers on connecting flights
Transfer:= sum(i,j in PLANES) PASS(i,j)*cont(i,j)
! One incoming and one outgoing flight per plane
forall(i in PLANES) sum(j in PLANES) cont(i,j) = 1
forall(j in PLANES) sum(i in PLANES) cont(i,j) = 1
! Solve the problem: maximize the number of passengers staying on board
maximize(Transfer)
writeln("Passengers staying on board: ", getobjval)
forall(i in PLANES)
writeln(i, "->", getsol(sum(j in PLANES)j*cont(i,j)),"(",
getsol(sum(j in PLANES)PASS(i,j)*cont(i,j)),")")
end-model

Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by