-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Motivation
INTEGRAL FLOW WITH HOMOLOGOUS ARCS (P111) from Garey & Johnson, A2 ND35. A classical NP-complete problem that generalizes standard network flow by requiring equal flow on designated pairs of "homologous" arcs. The integrality constraint combined with the equal-flow requirement makes the problem intractable, even though the non-integral variant reduces to linear programming.
Associated reduction rules:
- As source: [Rule] IntegralFlowHomologousArcs → ILP #733: IntegralFlowHomologousArcs → ILP
- As target: [Rule] Satisfiability → IntegralFlowHomologousArcs #732: Satisfiability → IntegralFlowHomologousArcs, [Rule] 3SAT to INTEGRAL FLOW WITH HOMOLOGOUS ARCS #365: 3SAT → IntegralFlowHomologousArcs
Definition
Name: IntegralFlowHomologousArcs
Canonical name: INTEGRAL FLOW WITH HOMOLOGOUS ARCS
Reference: Garey & Johnson, Computers and Intractability, A2 ND35
Mathematical definition:
INSTANCE: Directed graph G = (V,A), specified vertices s and t, capacity c(a) ∈ Z^+ for each a ∈ A, requirement R ∈ Z^+, set H ⊆ A × A of "homologous" pairs of arcs.
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}, flow is conserved at v,
(3) for all pairs <a,a'> ∈ H, f(a) = f(a'), and
(4) the net flow into t is at least R?
Variables
- Count: |A| (one variable per arc in the directed graph).
- Per-variable domain: {0, 1, ..., c(a)} where c(a) is the capacity of arc a. In the unit-capacity case, domain is {0, 1}.
- Meaning: Each variable f(a) represents the integer flow on arc a. A configuration is a valid integral flow if it satisfies capacity constraints, flow conservation at all non-terminal vertices, equal-flow constraints on homologous pairs, and achieves total flow into t of at least R.
Schema (data type)
Type name: IntegralFlowHomologousArcs
Variants: None (single variant; problem is always on a directed graph with integer capacities).
| Field | Type | Description |
|---|---|---|
num_vertices |
usize |
Number of vertices |V| |
arcs |
Vec<(usize, usize)> |
Directed arcs (u, v) in the graph |
capacities |
Vec<u64> |
Capacity c(a) for each arc |
source |
usize |
Source vertex s |
sink |
usize |
Sink vertex t |
requirement |
u64 |
Flow requirement R |
homologous_pairs |
Vec<(usize, usize)> |
Pairs of arc indices that must carry equal flow |
Notes:
- This is a satisfaction (decision) problem:
Metric = bool, implementingSatisfactionProblem. - The problem asks whether there exists an integral flow meeting all constraints.
- NP-complete even with unit capacities (c(a) = 1 for all a).
- The non-integral version is polynomially equivalent to LINEAR PROGRAMMING.
Complexity
- Best known exact algorithm: The problem is NP-complete (Sahni, 1974). Brute-force enumeration over all possible integer flow assignments takes O(∏_{a ∈ A} (c(a)+1)) time. With unit capacities, this is O(2^|A|). No significantly better exact algorithm is known for the general case.
- Complexity string:
"2^num_arcs"(unit-capacity case) - NP-completeness: Referenced by Garey & Johnson as transformation from 3SAT (Sahni, 1974). Remains NP-complete with unit capacities (Even, Itai, and Shamir, 1976).
- Special cases: The variant without integrality constraint (allowing real-valued flows with equal-flow constraints) is polynomially equivalent to LINEAR PROGRAMMING (Itai, 1977).
- References:
- S. Sahni (1974). "Computationally related problems". SIAM Journal on Computing 3, pp. 262-279.
- S. Even, A. Itai, A. Shamir (1976). "On the complexity of timetable and multicommodity flow problems". SIAM J. Comput. 5, pp. 691-703.
- A. Itai (1977). "Two commodity flow". Dept. of Computer Science, Technion. (Technical report; the journal version may have appeared in 1978.)
Extra Remark
Full book text:
INSTANCE: Directed graph G = (V,A), specified vertices s and t, capacity c(a) ∈ Z^+ for each a ∈ A, requirement R ∈ Z^+, set H ⊆ A × A of "homologous" pairs of arcs.
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}, flow is conserved at v,
(3) for all pairs <a,a'> ∈ H, f(a) = f(a'), and
(4) the net flow into t is at least R?
Reference: [Sahni, 1974]. Transformation from 3SAT.
Comment: Remains NP-complete if c(a) = 1 for all a ∈ A (by modifying the construction in [Even, Itai, and Shamir, 1976]). Corresponding problem with non-integral flows is polynomially equivalent to LINEAR PROGRAMMING [Itai, 1977].
How to solve
- It can be solved by (existing) bruteforce.
- It can be solved by reducing to integer programming.
- Other: Enumerate all integer flow assignments on arcs (exponential), check capacity, conservation, homologous-pair, and requirement constraints. Alternatively, formulate as an ILP with flow variables, capacity constraints, conservation constraints, and equality constraints for homologous pairs.
Example Instance
Instance (YES):
Directed graph with 6 vertices {0=s, 1, 2, 3, 4, 5=t} and 8 arcs:
- a_0 = (0,1) cap 1, a_1 = (0,2) cap 1, a_2 = (1,3) cap 1, a_3 = (2,3) cap 1
- a_4 = (1,4) cap 1, a_5 = (2,4) cap 1, a_6 = (3,5) cap 1, a_7 = (4,5) cap 1
- Homologous pairs: H = {(a_2, a_5), (a_4, a_3)} meaning f(a_2)=f(a_5) and f(a_4)=f(a_3).
- Requirement R = 2.
Solution: f(a_0)=1, f(a_1)=1, f(a_2)=1, f(a_5)=1, f(a_4)=0, f(a_3)=0, f(a_6)=1, f(a_7)=1.
- Capacity: all flows <= 1.
- Conservation: vertex 1: in=1(a_0), out=1(a_2)+0(a_4)=1. vertex 2: in=1(a_1), out=0(a_3)+1(a_5)=1. vertex 3: in=1(a_2)+0(a_3)=1, out=1(a_6). vertex 4: in=0(a_4)+1(a_5)=1, out=1(a_7).
- Homologous: f(a_2)=f(a_5)=1, f(a_4)=f(a_3)=0.
- Net flow into t=5: f(a_6)+f(a_7) = 2 >= R=2. Answer: YES.
Instance (NO):
Directed graph with 4 vertices {0=s, 1, 2, 3=t} and 4 arcs (all unit capacity):
- a_0 = (0,1) cap 1, a_1 = (0,2) cap 1, a_2 = (1,2) cap 1, a_3 = (2,3) cap 1
- Homologous pairs: H = {(a_0, a_1)}, meaning f(a_0) = f(a_1).
- Requirement R = 1.
Without the homologous constraint, R = 1 is achievable: send flow along s→1→2→t with f(a_0)=1, f(a_2)=1, f(a_3)=1, f(a_1)=0. Flow into t = 1 ≥ R.
With H: f(a_0) = f(a_1), so both must be 0 or 1 (unit capacity).
- If f(a_0) = f(a_1) = 1: by conservation at vertex 1, f(a_2) = f(a_0) = 1. At vertex 2: inflow = f(a_1) + f(a_2) = 1 + 1 = 2, but outflow = f(a_3) ≤ 1. Conservation violated.
- If f(a_0) = f(a_1) = 0: no flow enters the network. Flow = 0 < R = 1.
Answer: NO. The homologous constraint forces equal flow on both paths out of s, creating a bottleneck at vertex 2 that prevents any feasible flow of value 1.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status