Skip to content

[Model] CapacityAssignment #411

@isPANN

Description

@isPANN

Motivation

CAPACITY ASSIGNMENT (P155) from Garey & Johnson, A4 SR7. An NP-complete bicriteria optimization problem arising in communication network design. Each communication link must be assigned a capacity from a discrete set, balancing total cost against total delay penalty, subject to the monotonicity constraint that higher capacity costs more but incurs less delay. Proved NP-complete by Van Sickle and Chandy (1977) via reduction from SUBSET SUM.

Associated rules:

  • R101: SubsetSum → CapacityAssignment (as target)

Definition

Name: CapacityAssignment
Canonical name: CAPACITY ASSIGNMENT
Reference: Garey & Johnson, Computers and Intractability, A4 SR7

Mathematical definition:

INSTANCE: Set C of communication links, set M ⊆ Z+ of capacities, cost function g: C x M → Z+, delay penalty function d: C x M → Z+ such that for all c ∈ C and i < j ∈ M, g(c,i) ≤ g(c,j) and d(c,i) ≥ d(c,j), and positive integers K and J.
QUESTION: Is there an assignment σ: C → M such that the total cost ∑_{c ∈ C} g(c,σ(c)) does not exceed K and such that the total delay penalty ∑_{c ∈ C} d(c,σ(c)) does not exceed J?

Variables

  • Count: |C| variables, one per communication link. Each variable selects a capacity from M.
  • Per-variable domain: {1, 2, ..., |M|} — index into the ordered set of capacities M.
  • Meaning: Variable i encodes the capacity assigned to link c_i. A satisfying assignment σ maps each link to a capacity such that both the total cost budget K and total delay budget J are met simultaneously. The monotonicity constraints (higher capacity = higher cost, lower delay) make this a bicriteria trade-off.

Schema (data type)

Type name: CapacityAssignment
Variants: none (no graph or weight type parameter)

Field Type Description
num_links usize Number of communication links
capacities Vec<u64> Ordered set M of available capacities
cost Vec<Vec<u64>> Cost matrix g: cost[i][j] = g(c_i, M[j])
delay Vec<Vec<u64>> Delay matrix d: delay[i][j] = d(c_i, M[j])
cost_budget u64 Cost budget K
delay_budget u64 Delay budget J

Notes:

  • This is a satisfaction (decision) problem: Metric = bool, implementing SatisfactionProblem.
  • The monotonicity constraints are: for all i and j1 < j2 in M, cost[i][j1] ≤ cost[i][j2] and delay[i][j1] ≥ delay[i][j2].
  • No weight or graph type parameters needed.

Complexity

  • Best known exact algorithm: O*(|M|^|C|) brute force over all assignments. Since the problem is solvable in pseudo-polynomial time (as noted in GJ), a dynamic programming approach runs in O(|C| · K · J) time, which is pseudo-polynomial when K and J are bounded by a polynomial in the input size. The DP iterates over links and maintains a 2D table of (cost-so-far, delay-so-far) states.
  • Complexity string: "num_capacities ^ num_links"
  • NP-completeness: NP-complete (Van Sickle and Chandy, 1977). Transformation from SUBSET SUM.
  • Special cases: With |M| = 2, the problem reduces to a form of SUBSET SUM / bicriteria knapsack. Pseudo-polynomial when the budgets are polynomially bounded.
  • References:
    • Lawrence Van Sickle and K. Mani Chandy (1977). "Computational Complexity of Network Design Algorithms." Proc. IFIP Congress 77, Toronto, 1977, pp. 235–239.

Extra Remark

Full book text:

INSTANCE: Set C of communication links, set M ⊆ Z+ of capacities, cost function g: C×M → Z+, delay penalty function d: C×M → Z+ such that, for all c ∈ C and i < j ∈ M, g(c,i) ≤ g(c,j) and d(c,i) ≥ d(c,j), and positive integers K and J.
QUESTION: Is there an assignment σ: C → M such that the total cost ∑c ∈ C g(c,σ(c)) does not exceed K and such that the total delay penalty ∑c ∈ C d(c,σ(c)) does not exceed J?
Reference: [Van Sickle and Chandy, 1977]. Transformation from SUBSET SUM.
Comment: Solvable in pseudo-polynomial time.

How to solve

  • It can be solved by (existing) bruteforce — enumerate all |M|^|C| assignments and check cost/delay budgets.
  • It can be solved by reducing to integer programming — minimize/check cost and delay as linear constraints with integer capacity variables.
  • Other: Pseudo-polynomial DP in O(|C| · K · J) time. Also reducible to 0-1 knapsack variants or bicriteria shortest path.

Example Instance

Instance 1 (YES, satisfiable):

  • Links: C = {c_1, c_2, c_3}
  • Capacities: M = {1, 2, 3}
  • Cost function g:
Link g(·,1) g(·,2) g(·,3)
c_1 1 3 6
c_2 2 4 7
c_3 1 2 5
  • Delay penalty function d:
Link d(·,1) d(·,2) d(·,3)
c_1 8 4 1
c_2 7 3 1
c_3 6 3 1
  • Monotonicity check: for each link, cost is non-decreasing and delay is non-increasing with capacity ✓

  • Cost budget: K = 10

  • Delay budget: J = 12

  • Assignment σ = (2, 2, 2): cost = 3+4+2 = 9 ≤ 10 ✓, delay = 4+3+3 = 10 ≤ 12 ✓ (best balanced)

  • Assignment σ = (1, 2, 3): cost = 1+4+5 = 10 ≤ 10 ✓, delay = 8+3+1 = 12 ≤ 12 ✓ (tightest on both budgets)

  • Assignment σ = (3, 1, 2): cost = 6+2+2 = 10 ≤ 10 ✓, delay = 1+7+3 = 11 ≤ 12 ✓

  • Failing assignment σ = (1, 1, 1): cost = 1+2+1 = 4 ≤ 10 ✓, delay = 8+7+6 = 21 > 12 ✗ (cheap but too slow)

  • Failing assignment σ = (3, 3, 3): cost = 6+7+5 = 18 > 10 ✗ (fast but too expensive)

  • 5 satisfying assignments out of 27 total (BruteForce-friendly)

  • Answer: YES

Instance 2 (YES, from Subset Sum reduction):
Constructed from SubsetSum A = {3, 7, 1, 8, 4, 12}, B = 15:

  • Links: C = {c_1, ..., c_6}
  • Capacities: M = {1, 2}
  • Cost: g(c_i, 1) = 0, g(c_i, 2) = a_i for each i
  • Delay: d(c_i, 1) = a_i, d(c_i, 2) = 0 for each i
  • K = 15, J = 20
  • Assignment σ(c_1)=2, σ(c_2)=1, σ(c_3)=1, σ(c_4)=2, σ(c_5)=2, σ(c_6)=1
    • Cost = 3+0+0+8+4+0 = 15 ≤ 15 ✓
    • Delay = 0+7+1+0+0+12 = 20 ≤ 20 ✓
  • Answer: YES

References

  • [Van Sickle and Chandy, 1977]: Lawrence Van Sickle and K. Mani Chandy (1977). "Computational Complexity of Network Design Algorithms." Proc. IFIP Congress 77, Toronto, 1977, pp. 235–239.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.modelA model problem to be implemented.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions