🧩 Constraint Solving POTD:Problem of the Day: Generalized Assignment Problem (GAP) #60814
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-09-21T11:34:59.679Z.
|
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 Generalized Assignment Problem (GAP) assigns
mjobs tonagents such that:jto agenticonsumesa_ijunits of capacityc_ijConcrete Instance
Imagine a cloud resource allocation scenario:
Feasible assignment: Job A → Agent 2 (cost 8, memory 2), Job B → Agent 1 (cost 7, memory 2), Job C → Agent 2 (cost 4, memory 2). Total cost = 19. Agent 1 uses 2/5 GB, Agent 2 uses 4/5 GB. ✓
Infeasible assignment: Job A → Agent 1 (3 GB), Job B → Agent 1 (2 GB), Job C → Agent 1 (3 GB). Total memory = 8 GB > 5 GB capacity. ✗
Why It Matters
Workforce scheduling in manufacturing: Companies assign production orders to machines or workers. Each machine has limited runtime per shift; each order has a processing time and profit margin. GAP finds the assignment that maximizes profit (or minimizes cost) while keeping each resource within its shift limit.
Cloud computing & container orchestration: Kubernetes and similar platforms solve variants of GAP to place containerized workloads on physical nodes. Each container requires CPU and memory; each node has fixed capacity. Minimizing cost (e.g., number of nodes used) or latency is the objective.
Delivery route optimization in logistics: Parcels are assigned to delivery vehicles, each with weight and volume limits. GAP minimizes the number of vehicles or total route distance.
Nursing shift scheduling: Shifts are assigned to nurses with different expertise and availability constraints. GAP balances workload while minimizing labor cost or preference violations.
Modeling Approaches
Approach 1: Mixed-Integer Linear Programming (MIP)
Decision variables:
x_ij ∈ {0, 1}= 1 if jobjis assigned to agenti, 0 otherwiseConstraints:
∀j: Σ_i x_ij = 1(each job assigned to exactly one agent)∀i: Σ_j a_ij × x_ij ≤ b_i(agent capacity constraint)Objective:
minimize: Σ_i Σ_j c_ij × x_ijTrade-offs:
Approach 2: Constraint Programming (CP)
Decision variables:
agent_j ∈ {1..n}= assigned agent for jobjcost_j ∈ Z= cost of assigning jobjtotal_cost ∈ Z= sum of all costsConstraints:
∀i: Σ_{j: agent_j = i} a_ij ≤ b_i(global capacity constraint per agent)∀j: cost_j = element(agent_j, [c_1j, c_2j, ..., c_nj])total_cost = Σ_j cost_jSearch:
Trade-offs:
Approach 3: Local Search / Simulated Annealing
Representation: Permutation
πwhereπ[j]= assigned agent for jobjMoves:
jto a different agentEvaluation:
exp(-ΔC / T)Trade-offs:
Example Model (Python + OR-Tools)
Key Techniques
1. Arc Consistency and Capacity Propagation
In CP, as agents fill up, fewer jobs can fit on them. Constraint propagation detects this early:
ihas only 2 GB left and all remaining unassigned jobs require ≥ 3 GB, prune agentifrom consideration.2. Variable and Value Ordering in Search
j, try agents in order of cost (increasing). This finds good solutions early, enabling branch-and-bound pruning.3. Symmetry Breaking & Relaxation
Challenge Corner
For readers to explore:
Symmetry & Redundancy: In our cloud instance example, suppose all agents are identical (same capacity, same costs for each job). How many equivalent solutions exist? Can you add constraints to break this symmetry and speed up search?
Hybrid Approach: Design a hybrid algorithm that:
Which technique should drive which?
Uncertainty Extension: Suppose job costs are uncertain (uniform random within ±10% of nominal value). Model this as a robust GAP that minimizes worst-case cost. How does your model change?
References
Pentico, D. W. (2007). "Assignment Problems: A Golden Anniversary Survey." European Journal of Operational Research, 176(2), 774–793.
Martello, S., & Toth, P. (1981). "An Algorithm for the Generalized Assignment Problem." Proceedings of the 2nd Operational Research Society Conference.
van Hoeve, W. J., & Miller, A. J. (2013). "Subgraph Isomorphism and Related Problems." In Handbook of Constraint Programming, Elsevier.
OR-Tools Documentation ((developers.google.com/redacted)
All reactions