A challenging optimization problem in the airline industry is determining which airports should be hub locations for an airline. In this demo, we show how to formulate this problem as a Constrained Quadratic Model (CQM) and use a hybrid solver to optimize and find feasible solutions.
The goal for this problem is to minimize costs for the airline, while providing transportation for all city pairs in demand by passengers.
To run the demo, type
python demo.py
The program will select 3 hubs out of a list of 25 different airports. The
information in the files flow.csv
and cost.csv
is used to determine the
optimal selection of hub airports, based on passenger flow and airline costs
found in these files.
A GIF will be produced that illustrates the feasible results found by the hybrid solver, as shown below.
In order to minimize costs, the airlines must consider several factors.
- The cost to operate a non-stop route (sometimes referred to as a leg). Note that costs between hub airports are discounted.
- The passenger demand for each leg (called the flow).
The demo reads in both of these factors from provided data files (cost.csv
and flow.csv
, respectively).
We have several additional constraints that must be satisfied in order for a route map to be feasible.
- Every leg must connect to a hub.
- Passengers only connect at hub airports.
- Each airport gets assigned exactly one hub.
- Only p hubs total.
The first two constraints ensure that any connecting airports are hubs.
For a list of n
cities, we define n^2
binary variables. A binary variable
(i,j)
is equal to 1 if city i
is assigned to a hub at city j
, and is
equal to 0 otherwise. In the real-world scenario, this translates to a flight
route / leg from city i
to city j
. In particular, we assign (i,i) = 1
if
and only if city i
is a hub.
With these variables, we can build the quadratic model for the problem. Our constraints translate to the following expressions in terms of the binary variables defined.
- If
(i,j) = 1
andi != j
, then(j,j) = 1
. In other words, if cityi
connects to cityj
, then cityj
must be a hub. - For each city
i
, exactly one cityj
exists with(i,j) = 1
. - Exactly
p
citiesi
exist with(i,i) = 1
.
Formulating the objective with these binary variables is a bit more complex, and the interested reader is referred to the paper referenced below.
O'Kelly, Morton E. "A quadratic integer program for the location of interacting hub facilities." European journal of operational research 32.3 (1987): 393-404.