• Logistics

Amazon Quantum Computing for Fulfillment Center Optimization

Amazon

Amazon's Supply Chain Optimization Technologies team used D-Wave hybrid and QAOA via Amazon Braket to address fulfillment center stow planning (bin packing QUBO) and pick path optimization (TSP), comparing quantum results to production operations research tools including CP-SAT and Gurobi.

Key Outcome
D-Wave hybrid improved stow density by 4% in pilot fulfillment center simulation; QAOA pick path optimization matches TSP heuristic quality in under 100ms for 30-stop routes.

Amazon operates over 200 million active product SKUs across a global network of fulfillment centers, and the efficiency of two core operations, stow planning (where to physically place inbound inventory) and pick path planning (the order in which warehouse associates retrieve items for outbound orders), directly determines cost per unit shipped. Classical operations research tools, primarily constraint programming (CP-SAT from Google OR-Tools) and mixed-integer programming (Gurobi), solve these problems at scale but face combinatorial explosion as SKU counts and order batching complexity grow. Amazon’s Supply Chain Optimization Technologies (SCOT) team initiated a Braket-based research program to assess whether quantum annealing (D-Wave Advantage) and gate-model QAOA could find competitive or superior solutions for problem instances in the 50-500 variable range, where classical solvers begin to show diminishing returns from heuristic approximations.

Stow planning is naturally formulated as a variant of bin packing: given a set of inbound items with dimensions and weights, and a set of storage locations with capacity and accessibility constraints (pick frequency, zone assignments, velocity tiers), assign items to locations to maximize storage density while minimizing future pick travel distance. This was encoded as a QUBO using D-Wave Ocean’s BinaryQuadraticModel (BQM) API, with penalty terms enforcing capacity constraints and a linear objective minimizing weighted travel distance. The pick path problem, in contrast, was formulated as a Traveling Salesman Problem (TSP) over a graph of warehouse locations, solved using QAOA on Amazon Braket’s SV1 state-vector simulator for circuit development and then on D-Wave Advantage via hybrid solvers for production-scale instances. Amazon’s Braket Hybrid Jobs feature enabled iterative VQE-style classical-quantum loops where the QAOA parameter optimizer (BFGS) called the quantum backend repeatedly until convergence, with job checkpointing between iterations.

import boto3
import numpy as np
from braket.aws import AwsDevice, AwsQuantumTask
from braket.circuits import Circuit, FreeParameter
from braket.devices import LocalSimulator
import dimod
from dwave.system import DWaveCliqueSampler, LeapHybridSampler
import networkx as nx

# --- Stow Planning: Bin Packing QUBO via D-Wave Ocean ---

def build_stow_qubo(items, locations, alpha=2.0):
    """
    Encode stow planning as QUBO.
    items: list of (weight, volume, pick_frequency)
    locations: list of (capacity_weight, capacity_volume, zone_travel_cost)
    Binary variable x_{i,j} = 1 if item i is placed in location j.
    """
    n_items = len(items)
    n_locs = len(locations)
    bqm = dimod.BinaryQuadraticModel(vartype='BINARY')

    # Objective: minimize sum of pick travel cost weighted by frequency
    for i, (w_i, v_i, freq_i) in enumerate(items):
        for j, (cap_w, cap_v, travel_j) in enumerate(locations):
            bqm.add_variable(f"x_{i}_{j}", freq_i * travel_j)

    # Constraint 1: each item placed in exactly one location (penalty alpha)
    for i in range(n_items):
        for j1 in range(n_locs):
            for j2 in range(j1 + 1, n_locs):
                bqm.add_interaction(f"x_{i}_{j1}", f"x_{i}_{j2}", 2 * alpha)
        for j in range(n_locs):
            bqm.add_variable(f"x_{i}_{j}", -alpha)

    # Constraint 2: location capacity not exceeded
    for j, (cap_w, cap_v, _) in enumerate(locations):
        weight_vars = [(f"x_{i}_{j}", items[i][0]) for i in range(n_items)]
        for (v1, w1), (v2, w2) in [(weight_vars[a], weight_vars[b])
                                    for a in range(len(weight_vars))
                                    for b in range(a+1, len(weight_vars))]:
            if w1 + w2 > cap_w:
                bqm.add_interaction(v1, v2, alpha * (w1 + w2 - cap_w))

    return bqm

# Example: 20 items, 8 locations
items = [(np.random.uniform(1, 10),
          np.random.uniform(0.1, 2.0),
          np.random.uniform(0.1, 1.0)) for _ in range(20)]
locations = [(15, 5.0, np.random.uniform(1, 50)) for _ in range(8)]
bqm = build_stow_qubo(items, locations)

sampler = LeapHybridSampler()
response = sampler.sample(bqm, time_limit=10)
best = response.first
print(f"Stow QUBO energy: {best.energy:.2f}")

# --- Pick Path: TSP-QAOA on Amazon Braket ---

def build_tsp_qaoa_circuit(distance_matrix, p=2):
    """
    Build QAOA circuit for TSP on n stops.
    Uses phase separator encoding travel cost as ZZ interactions.
    """
    n = len(distance_matrix)
    n_qubits = n * n  # one qubit per (city, time_step) pair
    circuit = Circuit()
    gammas = [FreeParameter(f"gamma_{i}") for i in range(p)]
    betas = [FreeParameter(f"beta_{i}") for i in range(p)]

    # Initial superposition
    for q in range(n_qubits):
        circuit.h(q)

    for layer in range(p):
        # Phase separator: encode TSP cost Hamiltonian
        for i in range(n):
            for j in range(n):
                if i != j:
                    for t in range(n):
                        q1 = i * n + t
                        q2 = j * n + ((t + 1) % n)
                        circuit.zz(q1, q2, gammas[layer] * distance_matrix[i][j])

        # Mixer: Rx rotations
        for q in range(n_qubits):
            circuit.rx(q, betas[layer])

    circuit.probability()
    return circuit

# 5-stop pick path example
n_stops = 5
dist_matrix = np.random.uniform(5, 100, (n_stops, n_stops))
np.fill_diagonal(dist_matrix, 0)

device = LocalSimulator()  # develop locally, switch to SV1 for scale
qaoa_circ = build_tsp_qaoa_circuit(dist_matrix, p=2)
print(f"QAOA circuit depth: {qaoa_circ.depth}")
print(f"Total qubits: {qaoa_circ.qubit_count}")

# Optimize QAOA parameters
from scipy.optimize import minimize

def qaoa_cost(params):
    gammas = params[:2]
    betas = params[2:]
    param_dict = {f"gamma_{i}": gammas[i] for i in range(2)}
    param_dict.update({f"beta_{i}": betas[i] for i in range(2)})
    task = device.run(qaoa_circ, shots=500, inputs=param_dict)
    probs = task.result().values[0]
    # Evaluate expected cost (simplified: highest probability bitstring)
    return float(np.dot(probs, np.arange(len(probs))))

result = minimize(qaoa_cost, x0=[0.5, 0.3, 0.4, 0.2], method='BFGS')
print(f"Optimized QAOA parameters: {result.x}")

Benchmarking against CP-SAT (Google OR-Tools) and Gurobi on 50 representative problem instances showed that D-Wave hybrid achieved within 2% of Gurobi’s optimal stow density solution in 95% of cases while running 3x faster for instances with more than 150 binary variables, a regime where Gurobi’s branch-and-bound search begins to slow. The 4% stow density improvement in the pilot simulation translates to meaningful storage cost reduction across Amazon’s fulfillment network at scale. QAOA pick path results were competitive with the classical 2-opt TSP heuristic for 30-stop routes (the typical batch size for a single pick wave), completing in under 100ms on SV1, fast enough for real-time integration into warehouse management systems. The SCOT team identified the transition point where quantum hybrid solvers begin to show consistent advantage over classical heuristics at roughly 200-400 binary variables, guiding the roadmap for production integration as hardware scales.