Skip to content

[Model] IntegralFlowWithMultipliers #290

@isPANN

Description

@isPANN

name: Problem
about: Propose a new problem type
title: "[Model] IntegralFlowWithMultipliers"
labels: model
assignees: ''

Motivation

INTEGRAL FLOW WITH MULTIPLIERS (P109) from Garey & Johnson, A2 ND33. A generalization of the standard network flow problem where each intermediate vertex v has a multiplier h(v) that scales the incoming flow before comparing it with the outgoing flow. This small change makes the problem NP-complete (the standard case with all h(v) = 1 is polynomial). Arises in lossy network models where flow is gained or lost at intermediate nodes (e.g., water networks with leakage, currency exchange networks).

Associated reduction rules:

  • As source: None found in the current rule set.
  • As target: R54: PARTITION -> INTEGRAL FLOW WITH MULTIPLIERS

Definition

Name: IntegralFlowWithMultipliers

Canonical name: INTEGRAL FLOW WITH MULTIPLIERS (also: Network Flow with Gains/Losses, Lossy/Gainy Flow)
Reference: Garey & Johnson, Computers and Intractability, A2 ND33

Mathematical definition:

INSTANCE: Directed graph G = (V,A), specified vertices s and t, multiplier h(v) ∈ Z^+ for each v ∈ V - {s,t}, capacity c(a) ∈ Z^+ for each a ∈ A, requirement R ∈ Z^+.
QUESTION: Is there a flow function f: A -> Z_0^+ such that
(1) f(a) <= c(a) for all a ∈ A,
(2) for each v ∈ V - {s,t}, Sum_{(u,v) in A} h(v)*f((u,v)) = Sum_{(v,u) in A} f((v,u)), and
(3) the net flow into t is at least R?

Variables

  • Count: |A| integer variables (one per arc), representing the flow on each arc.
  • Per-variable domain: {0, 1, ..., c(a)} -- the flow on arc a is a non-negative integer bounded by its capacity.
  • Meaning: The variable assignment encodes the flow function. A satisfying assignment is a flow f such that capacity constraints, generalized conservation constraints (with multipliers), and the requirement R on net flow into t are all met.

Dims

[c(a_1)+1, c(a_2)+1, ..., c(a_m)+1] where m = |A|. Each variable (flow on arc a_i) ranges over {0, 1, ..., c(a_i)}.

Schema (data type)

Type name: IntegralFlowWithMultipliers
Variants: None (the directed graph and integer types are fixed)

Field Type Description
graph DirectedGraph Directed graph G = (V, A)
source usize Index of source vertex s
sink usize Index of sink vertex t
multipliers Vec<u64> Multiplier h(v) for each vertex (length num_vertices; values at source and sink indices are ignored)
capacities Vec<u64> Capacity c(a) for each arc
requirement u64 Flow requirement R

Notes:

  • This is a satisfaction (decision) problem: Metric = bool, implementing SatisfactionProblem.
  • Multipliers h(v) only apply to intermediate vertices (not s or t).
  • The generalized conservation constraint scales incoming flow by h(v): h(v) * (total in-flow) = total out-flow.
  • When h(v) = 1 for all v, this is standard max-flow (polynomial).
  • The non-integral version can be solved by linear programming.

Size Fields

Getter name Meaning
num_vertices Number of vertices
num_arcs Number of arcs
max_capacity Maximum capacity max_a c(a)
requirement Flow requirement R

Complexity

  • Best known exact algorithm: The problem is NP-complete in general. Brute-force enumeration of integer flow assignments: O((max_capacity + 1)^num_arcs). A pseudo-polynomial dynamic programming approach (similar to the Subset Sum DP) applies when capacities are bounded.
  • Concrete bound for declare_variants!: "(max_capacity + 1)^num_arcs"
  • Special cases: When all h(v) = 1, solvable in polynomial time via standard max-flow algorithms (e.g., Edmonds-Karp O(|V|·|E|²), push-relabel O(|V|²·|E|)). The rational (non-integral) version is solvable via linear programming regardless of multiplier values.
  • NP-completeness: NP-complete by transformation from PARTITION (Sahni, 1974).
  • References:
    • S. Sahni (1974). "Computationally related problems." SIAM Journal on Computing, 3:262-279.
    • W.S. Jewell (1962). "Optimal flow through networks with gains." Operations Research, 10(4):476-499.

Extra Remark

Full book text:

INSTANCE: Directed graph G = (V,A), specified vertices s and t, multiplier h(v) ∈ Z^+ for each v ∈ V - {s,t}, capacity c(a) ∈ Z^+ for each a ∈ A, requirement R ∈ Z^+.
QUESTION: Is there a flow function f: A -> Z_0^+ such that
(1) f(a) <= c(a) for all a ∈ A,
(2) for each v ∈ V - {s,t}, Sum_{(u,v) in A} h(v)*f((u,v)) = Sum_{(v,u) in A} f((v,u)), and
(3) the net flow into t is at least R?
Reference: [Sahni, 1974]. Transformation from PARTITION.
Comment: Can be solved in polynomial time by standard network flow techniques if h(v) = 1 for all v ∈ V - {s,t}. Corresponding problem with non-integral flows allowed can be solved by linear programming.

How to solve

  • It can be solved by (existing) bruteforce -- enumerate all integer flow assignments on arcs and verify constraints.
  • It can be solved by reducing to integer programming -- ILP with capacity, conservation (with multipliers), and flow requirement constraints.
  • Other: When all h(v) = 1, standard max-flow algorithms apply (Edmonds-Karp, push-relabel).

Example Instance

Instance 1 (YES -- feasible integral flow exists):
Directed graph with 8 vertices {s, v_1, v_2, v_3, v_4, v_5, v_6, t}:

  • Arcs from s: (s, v_1) c=1, (s, v_2) c=1, (s, v_3) c=1, (s, v_4) c=1, (s, v_5) c=1, (s, v_6) c=1
  • Arcs to t: (v_1, t) c=2, (v_2, t) c=3, (v_3, t) c=4, (v_4, t) c=5, (v_5, t) c=6, (v_6, t) c=4
  • Multipliers: h(v_1)=2, h(v_2)=3, h(v_3)=4, h(v_4)=5, h(v_5)=6, h(v_6)=4
  • R = 12

This encodes PARTITION of {2, 3, 4, 5, 6, 4} (sum = 24, target = 12).

Flow: f(s,v_1)=1, f(v_1,t)=2; f(s,v_3)=1, f(v_3,t)=4; f(s,v_5)=1, f(v_5,t)=6.
All other flows = 0.

  • Conservation: h(v_1)*1 = 2 = f(v_1,t). h(v_3)*1 = 4 = f(v_3,t). h(v_5)*1 = 6 = f(v_5,t).
  • Net flow into t: 2 + 4 + 6 = 12 = R.
  • Answer: YES

Instance 2 (NO -- no feasible flow):
Directed graph with 4 vertices {s, v_1, v_2, t} and 5 arcs (diamond structure with internal arc):

  • Arcs: (s, v_1) c=2, (s, v_2) c=1, (v_1, t) c=2, (v_2, t) c=5, (v_1, v_2) c=1
  • Multipliers: h(v_1)=2, h(v_2)=3
  • R = 7

Conservation at v_1: 2 · f(s, v_1) = f(v_1, t) + f(v_1, v_2)
Conservation at v_2: 3 · (f(s, v_2) + f(v_1, v_2)) = f(v_2, t)

Exhaustive case analysis:

  • f(s, v_1) = 0: f(v_1, t) = 0, f(v_1, v_2) = 0. Best: f(s, v_2) = 1, f(v_2, t) = 3. Total = 3.
  • f(s, v_1) = 1: 2 · 1 = f(v_1, t) + f(v_1, v_2) = 2.
    • (f(v_1, t), f(v_1, v_2)) = (2, 0): f(s, v_2) = 1 → f(v_2, t) = 3. Total = 2 + 3 = 5.
    • (f(v_1, t), f(v_1, v_2)) = (1, 1): f(s, v_2) = 1 → f(v_2, t) = 3 · (1 + 1) = 6 > 5 ✗. f(s, v_2) = 0 → f(v_2, t) = 3 · 1 = 3. Total = 1 + 3 = 4.
  • f(s, v_1) = 2: 2 · 2 = 4, but f(v_1, t) ≤ 2 and f(v_1, v_2) ≤ 1, max = 3 < 4 ✗.

Maximum achievable flow = 5 < 7 = R.

  • Answer: NO
  • Why: The multipliers amplify flow at intermediate vertices, but capacity limits on arcs to t and the internal arc (v_1, v_2) create bottlenecks that prevent enough amplified flow from reaching the sink.

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