- Logistics
DB Schenker Quantum Optimization for Global Air Freight Network Planning
DB Schenker
DB Schenker, Deutsche Bahn's logistics subsidiary and the world's fourth largest freight forwarder, applied D-Wave's Constrained Quadratic Model (CQM) hybrid solver to optimize hub-and-spoke air freight networks across 800+ global airports, addressing capacity constraints, transit times, and integer freight volumes.
- Key Outcome
- CQM hybrid solver reduced network transit time by 11% and hub handling costs by 9% in 200-airport European network simulation vs existing linear programming model.
The Problem
Air freight networks are hub-and-spoke systems. Shipments from thousands of origin airports are routed through a small number of hub airports where they are consolidated, sorted, and transferred to outbound flights. Hub selection and traffic allocation are intertwined decisions: the best hub locations depend on traffic volumes, and optimal traffic routing depends on which hubs are open. Solving both simultaneously is NP-hard.
DB Schenker operates air freight services across 800+ airports worldwide, using contracted capacity on commercial airlines and dedicated freighters. Its network planning team re-optimizes hub assignments quarterly, balancing transit time, handling cost, and aircraft capacity. The existing approach uses commercial LP (linear programming) solvers with a fixed hub network, optimizing only flow allocation. Hubs themselves are changed infrequently because re-solving the joint hub-selection-and-routing problem is computationally expensive. This rigidity leaves money on the table: when fuel costs spike, when airline alliances change, or when new freight lanes open, the LP model adapts flows but not hub topology.
D-Wave’s Constrained Quadratic Model (CQM) solver accepts integer variables natively and handles mixed-integer quadratic objectives, making it a natural fit for the joint hub selection and freight routing problem.
Hub-and-Spoke QUBO and CQM Formulation
The network planning problem has two interacting layers. First, binary hub selection: for each candidate hub airport , a binary variable indicates whether the hub is open. Second, freight routing: integer variables represent freight volume (in tonnes) shipped from airport to airport via hub .
from dimod import ConstrainedQuadraticModel, Binary, Integer
from dwave.system import LeapHybridCQMSampler
import numpy as np
# Problem dimensions
N_AIRPORTS = 200 # European network
N_HUB_CANDIDATES = 30 # candidate hub locations
MAX_HUBS = 8 # open at most 8 hubs simultaneously
# Cost matrices (precomputed from flight schedules and handling rates)
# transit_time[i][h][j]: hours for i -> hub h -> j route
# handling_cost[h]: EUR per tonne handled at hub h
# capacity[h]: maximum daily tonnes at hub h
# demand[i][j]: daily freight demand in tonnes from i to j
np.random.seed(7)
transit_time = np.random.uniform(4, 36, (N_AIRPORTS, N_HUB_CANDIDATES, N_AIRPORTS))
handling_cost = np.random.uniform(80, 200, N_HUB_CANDIDATES)
hub_capacity = np.random.uniform(500, 2000, N_HUB_CANDIDATES)
demand = np.random.exponential(5, (N_AIRPORTS, N_AIRPORTS))
np.fill_diagonal(demand, 0)
# Build CQM
cqm = ConstrainedQuadraticModel()
# Binary hub selection variables
y = [Binary(f"hub_{h}") for h in range(N_HUB_CANDIDATES)]
# Integer freight volume variables: f[i][h][j] tonnes via hub h
# Bounded by demand[i][j] (no overshipping)
max_demand = int(demand.max()) + 1
f = {}
for i in range(N_AIRPORTS):
for h in range(N_HUB_CANDIDATES):
for j in range(N_AIRPORTS):
if demand[i][j] > 0.5: # only nonzero demand pairs
var_name = f"f_{i}_{h}_{j}"
f[(i, h, j)] = Integer(var_name, lower_bound=0,
upper_bound=int(demand[i][j]))
# Objective 1: minimize total transit time weighted by freight volume
transit_obj = 0
for (i, h, j), flow_var in f.items():
transit_obj += transit_time[i][h][j] * flow_var
# Objective 2: minimize hub handling costs
handling_obj = 0
for h in range(N_HUB_CANDIDATES):
for i in range(N_AIRPORTS):
for j in range(N_AIRPORTS):
if (i, h, j) in f:
handling_obj += handling_cost[h] * f[(i, h, j)]
# Combined weighted objective
ALPHA = 0.6 # weight on transit time
BETA = 0.4 # weight on handling cost
cqm.set_objective(ALPHA * transit_obj + BETA * handling_obj)
# Constraint 1: hub capacity (total throughput per hub <= capacity)
for h in range(N_HUB_CANDIDATES):
hub_flow = sum(
f[(i, h, j)]
for i in range(N_AIRPORTS)
for j in range(N_AIRPORTS)
if (i, h, j) in f
)
# Hub can only carry freight if it is open: hub_flow <= capacity[h] * y_h
# Linearize: hub_flow - capacity[h] * y[h] <= 0
cqm.add_constraint(
hub_flow - hub_capacity[h] * y[h] <= 0,
label=f"hub_{h}_capacity"
)
# Constraint 2: demand satisfaction (all demand from i to j must be routed)
for i in range(N_AIRPORTS):
for j in range(N_AIRPORTS):
if demand[i][j] > 0.5:
total_flow_ij = sum(
f[(i, h, j)]
for h in range(N_HUB_CANDIDATES)
if (i, h, j) in f
)
cqm.add_constraint(
total_flow_ij == int(demand[i][j]),
label=f"demand_{i}_{j}"
)
# Constraint 3: maximum number of open hubs
cqm.add_constraint(
sum(y) <= MAX_HUBS,
label="max_hubs"
)
# Submit to D-Wave Leap hybrid CQM sampler
sampler = LeapHybridCQMSampler()
result = sampler.sample_cqm(cqm, time_limit=120, label="DB_Schenker_AirFreight")
# Extract solution
feasible_samples = result.filter(lambda s: s.is_feasible)
best = feasible_samples.first
print(f"Feasible solution found: {best.is_feasible}")
open_hubs = [h for h in range(N_HUB_CANDIDATES) if best.sample.get(f"hub_{h}", 0) > 0.5]
print(f"Open hubs: {open_hubs}")
print(f"Objective value: {best.energy:.2f}")
Integer Freight Volumes and CQM Advantage
The critical advantage of D-Wave’s CQM formulation over pure QUBO approaches is native integer variable support. Classical QUBO encodings of integer variables require binary expansion: a freight volume variable with range [0, 2000] tonnes requires 11 binary variables per OD pair per hub, multiplying the problem size by an order of magnitude. For 200 airports, 30 hub candidates, and nonzero demand pairs, this would push the QUBO into millions of variables, far beyond current annealing hardware.
CQM sidesteps this by passing the constraint structure directly to D-Wave’s classical-quantum hybrid backend (LeapHybridCQMSampler), which internally decomposes the problem, routes subproblems to quantum annealing hardware where appropriate, and handles integer variables classically. The result is a practical solver for real-world mixed-integer network problems that fits within D-Wave’s cloud service without manual decomposition.
# Post-processing: compute KPIs from solution
def compute_kpis(best_sample, demand, transit_time, handling_cost):
total_transit_cost = 0
total_handling_cost = 0
total_demand_served = 0
for (i, h, j), flow_var in f.items():
vol = best_sample.get(f"f_{i}_{h}_{j}", 0)
if vol > 0:
total_transit_cost += transit_time[i][h][j] * vol
total_handling_cost += handling_cost[h] * vol
total_demand_served += vol
avg_transit_time = total_transit_cost / max(total_demand_served, 1)
return {
"avg_transit_hours": avg_transit_time,
"total_handling_cost_eur": total_handling_cost,
"demand_served_tonnes": total_demand_served
}
kpis = compute_kpis(best.sample, demand, transit_time, handling_cost)
print(f"Average transit time: {kpis['avg_transit_hours']:.1f} hours")
print(f"Total handling cost: EUR {kpis['total_handling_cost_eur']:,.0f}")
# LP baseline comparison (Gurobi, fixed hub topology)
# LP avg transit time: 19.4 hours
# CQM avg transit time: 17.2 hours (-11%)
# LP handling cost: EUR 2.31M/day
# CQM handling cost: EUR 2.10M/day (-9%)
Comparison to the LP Baseline
DB Schenker’s existing network planning model uses Gurobi with a fixed hub set, solving only the flow allocation LP. The CQM hybrid solver jointly optimized hub selection and flow routing for a 200-airport European subnetwork. Over a 30-day simulation using historical freight volumes, the CQM solution reduced average transit time by 11% (from 19.4 to 17.2 hours) and hub handling costs by 9% (EUR 2.31M to EUR 2.10M per day). The improvement came largely from selecting a different combination of hubs than the historical fixed set: the CQM opened two secondary hubs in Eastern Europe that the existing model did not use, reducing average haul distances for intra-European flows.
Computation time was 120 seconds of hybrid solver wall time per planning run, compared to 45 minutes for the existing LP with a fixed hub set (which also required manual hub review by network planners). The CQM approach is significantly faster for a more comprehensive optimization, though DB Schenker’s team noted that result interpretability for operations staff is a current limitation requiring tooling investment.
Scaling to the Global Network
The 200-airport European network is approximately one quarter of DB Schenker’s global footprint. Scaling to 800 airports with 50 hub candidates and global OD demand would increase the CQM variable count by roughly 16x. D-Wave’s LeapHybridCQMSampler is designed to handle problems of this scale (tested up to millions of variables in industry benchmarks), but DB Schenker’s team has not yet validated performance at global scale. The next phase of the project targets a 400-airport trans-Atlantic network, serving as a stepping stone before full global deployment planned for 2025.