Repository navigation
🧩 Constraint Solving POTD:Problem of the Day: Quadratic Assignment Problem (QAP) #71117
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by Constraint Solving — Problem of the Day. A newer discussion is available at Discussion #71421. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem Statement
The Quadratic Assignment Problem (QAP) asks: given
nfacilities andnlocations, assign each facility to exactly one location (and vice versa) to minimize the total "interaction cost" between all facility pairs.More formally, let
d[i,j]be the distance (or flow) between facilitiesiandj, and letc[l,m]be the cost to place two locationslandmapart. If we assign facilityito locationπ(i), the objective is:Concrete Instance (4-facilities, 4-locations):
Consider 4 departments in an office:
Objective: Find an assignment that minimizes total interaction cost, accounting for both flow frequency and physical distances. For example, since Admin and Sales have high flow (8), they should be placed close together.
Why It Matters
Facility Layout & Factory Design: QAP models the optimal arrangement of production areas in a manufacturing plant. High-volume material flows between departments should minimize transport distance—a classic problem in industrial engineering.
Electronic Circuit Board Design: VLSI designers use QAP to place logical components on a chip to minimize wire lengths; shorter wires reduce latency and power consumption.
Data Center Rack Configuration: Assign servers to racks to minimize network congestion and latency for frequently communicating services.
Organizational Seating: Allocate office spaces so teams that collaborate frequently sit near one another, improving communication and reducing commute time within the building.
Modeling Approaches
Approach 1: Quadratic Assignment (Direct)
Paradigm: Mixed-Integer Quadratic Programming (MIQP) or Constraint Programming with quadratic objectives.
Decision variables:
x[i,l]∈ {0,1}: binary variable = 1 if facilityiis assigned to locationlConstraints:
Σ_l x[i,l] = 1for alli(each facility assigned to exactly one location)Σ_i x[i,l] = 1for alll(each location receives exactly one facility)Objective:
Trade-offs:
n > 20unless symmetry-breaking is applied.Approach 2: Linearization via Auxiliary Variables
Paradigm: Mixed-Integer Linear Programming (MILP).
Decision variables:
x[i,l]∈ {0,1}: facility-to-location assignment (as above)y[i,j,l,m]∈ {0,1}: auxiliary variable = 1 ifx[i,l] = 1ANDx[j,m] = 1Constraints:
y[i,j,l,m] ≤ x[i,l]y[i,j,l,m] ≤ x[j,m]y[i,j,l,m] ≥ x[i,l] + x[j,m] - 1Objective:
Trade-offs:
Example Model (OR-Tools / Python)
Key Techniques
1. Linearization & Big-M Constraints
The quadratic terms
x[i,l] · x[j,m]are linearized via auxiliary variables and inequalities, enabling the use of powerful MILP solvers. This is essential for handling large QAP instances.2. Symmetry Breaking
QAP has inherent symmetries (e.g., relabeling locations doesn't change the problem structure). Adding lexicographic ordering constraints on assignment variables can prune large portions of the search space without losing optimal solutions.
3. Bounding via Linear Relaxation
Solve the LP relaxation (allowing fractional x[i,l] values) to obtain a lower bound. Modern solvers use cutting planes and Gomory cuts to tighten this bound, guiding branch-and-bound more efficiently.
4. Specialized Search: Construction + Local Improvement
For large instances (n > 100), exact methods become intractable. Hybrid approaches combine:
Challenge Corner
Can you reduce the size of the model?
The standard linearized QAP has O(n4) auxiliary variables. But many d[i,j] or c[l,m] values may be zero (sparse flow/distance matrices). How would you exploit sparsity to build a smaller formulation? What about symmetries in the matrices—can you merge equivalent variables?
Extension: Suppose facilities have costs that depend on location (e.g., higher rent in premium locations). How would you extend the model to include a linear facility-location cost term, and what solver technique would still apply?
References
Çela, E. (1998). The Quadratic Assignment Problem: Theory and Algorithms. Kluwer Academic Publishers.
Loiola, E. M., de Abreu, N. M. M., et al. (2007). A Survey for the Quadratic Assignment Problem. European Journal of Operational Research, 176(2), 657–690.
Burkard, R. E., Karisch, S. E., & Rendl, F. (1997). QAPLIB—A Quadratic Assignment Problem Library. Journal of Global Optimization, 10(4), 391–403.
Google OR-Tools Solver Documentation: (developers.google.com/redacted)
Next time on Problem of the Day: Dive into a Satisfiability problem—or a Classic CSP challenge. Share your thoughts on QAP extensions in the comments!
All reactions