Source: PARTITION
Target: INTEGRAL FLOW WITH MULTIPLIERS
Motivation: Establishes NP-completeness of INTEGRAL FLOW WITH MULTIPLIERS via a polynomial-time reduction from PARTITION. The reduction uses the standard vertex-multiplier gadget from Sahni's gain/loss-network construction: a unit of flow sent into item vertex v_i is amplified to exactly a_i units on its outgoing arc, so feasible integral flows encode subset selection. The crucial sink-side bottleneck then forces the selected subset to sum to exactly half the total, matching PARTITION rather than merely SUBSET-SUM with a lower bound.
Reference: Sahni, "Computationally Related Problems," SIAM Journal on Computing 3(4):262-279, 1974, Fig. 2.2.1 (the applicable ND33 construction); catalogued as ND33 in Garey & Johnson, Computers and Intractability, p.215. Even-Itai-Shamir (1976, SIAM Journal on Computing 5(4):691-703) concerns other Garey-Johnson flow entries, not this multiplier-flow reduction.
GJ Source Entry
[ND33] INTEGRAL FLOW WITH MULTIPLIERS
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)∈A} h(v)*f((u,v)) = Sum_{(v,u)∈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.
Reduction Algorithm
Summary:
Let the PARTITION instance be the multiset A = {a_1, a_2, ..., a_n} of positive integers, and let S = sum_i a_i.
This reduction is Sahni's 1974 sum of subsets -> N(i) construction (Fig. 2.2.1 in SIAM Journal on Computing 3(4)), specialized to the PARTITION target value M = S/2 when S is even. The relay vertex w and the single arc (w,t) of capacity M are the load-bearing bottleneck from Sahni's figure; they are what make the sink inflow equal exactly M under this repository's net_flow(t) >= R semantics.
-
Odd-total preprocessing: If S is odd, output a fixed NO instance of INTEGRAL FLOW WITH MULTIPLIERS:
- vertices:
s, u, t
- arcs:
(s,u) and (u,t), both with capacity 1
- multiplier:
h(u) = 2
- requirement:
R = 1
This target instance is infeasible because conservation at u requires 2 * f(s,u) = f(u,t), but f(u,t) <= 1, so the only integral possibility is f(s,u) = f(u,t) = 0, which fails R = 1. This correctly maps every odd-total PARTITION instance to NO.
-
Even-total case: If S is even, let M = S/2 and construct the target instance exactly in Sahni's style.
-
Vertices: Create vertices s, t, a relay vertex w, and item vertices v_1, v_2, ..., v_n.
-
Arcs from the source: For each i = 1, ..., n, add arc (s, v_i) with capacity c(s, v_i) = 1.
-
Amplifying arcs into the relay: For each i = 1, ..., n, add arc (v_i, w) with capacity c(v_i, w) = a_i.
-
Single bottleneck arc into the sink: Add one arc (w, t) with capacity c(w, t) = M.
-
Multipliers: Set
h(v_i) = a_i for each item vertex v_i
h(w) = 1
Then conservation enforces
a_i * f(s, v_i) = f(v_i, w) at each v_i
f(w, t) = sum_i f(v_i, w) at w
-
Requirement: Set R = M.
-
Correctness (forward): If the PARTITION instance is YES, there is a subset I ⊆ {1, ..., n} with sum_{i in I} a_i = M. Set
f(s, v_i) = 1 and f(v_i, w) = a_i for i in I
f(s, v_i) = 0 and f(v_i, w) = 0 for i notin I
f(w, t) = M
All capacities are respected. At each v_i, conservation holds because a_i * f(s, v_i) = f(v_i, w). At w, because h(w)=1, conservation is sum_i f(v_i, w) = f(w, t) = M. Hence the sink receives net inflow M = R, so the target instance is YES.
-
Correctness (reverse): Suppose the constructed target instance is YES. For each i, the arc (s, v_i) has capacity 1, so integrality gives f(s, v_i) in {0,1}. Conservation at v_i forces f(v_i, w) = a_i * f(s, v_i), so each item contributes either 0 or exactly a_i into w. Conservation at w with h(w)=1 gives
f(w, t) = sum_i a_i * f(s, v_i).
The bottleneck arc (w, t) has capacity M, so f(w, t) <= M. The sink requirement says net inflow at t is at least R = M, and t has no outgoing arcs, so f(w, t) >= M. Therefore f(w, t) = M, hence
sum_i a_i * f(s, v_i) = M = S/2.
The selected indices I = { i : f(s, v_i) = 1 } therefore form a valid partition subset of exact half-sum. So the PARTITION instance is YES.
Key invariant: Sahni's item vertices convert each binary source choice f(s, v_i) in {0,1} into either 0 or a_i units entering the relay. The relay vertex w with multiplier 1, together with the single bottleneck arc (w,t) of capacity S/2, turns the repository's sink condition net_flow(t) >= R into an exact-equality test net_flow(t) = S/2.
Time complexity of reduction: O(n) time and O(n) graph size in the even branch; constant time and constant size in the odd branch.
Size Overhead
Symbols:
n = number of elements in the PARTITION instance
S = total sum sum_i a_i
a_max = max_i a_i
| Target metric (code name) |
Polynomial (using symbols above) |
num_vertices |
if S is even then n + 3 else 3 |
num_arcs |
if S is even then 2 * n + 1 else 2 |
max_capacity |
if S is even then max(a_max, S / 2) else 1 |
requirement |
if S is even then S / 2 else 1 |
Derivation: In the even branch, the construction has n item vertices plus s, w, and t, for n + 3 total vertices. It has n source arcs, n item-to-relay arcs, and one relay-to-sink bottleneck arc, for 2n + 1 arcs total. The odd branch returns a fixed 3-vertex, 2-arc NO instance. Thus the reduction has linear size overhead overall.
Validation Method
- Closed-loop test: reduce a PARTITION instance to
IntegralFlowWithMultipliers, solve the target with BruteForce, extract the selected subset from the unit-capacity source arcs, and verify that the extracted subset sums to exactly half of the source total.
- Test with a known YES instance:
A = {1, 2, 3, 4, 5, 5} with S = 20; the bottleneck should force sink inflow exactly 10.
- Test with an even-sum NO instance:
A = {3, 5} with S = 8; without the bottleneck this was a false positive, but with Sahni's relay-and-cap construction no feasible flow can reach requirement 4.
- Test with an odd-sum NO instance:
A = {1, 2} with S = 3; the reduction must return the fixed NO target instance from Step 1.
- Compare the construction against Sahni's Fig. 2.2.1: source-to-item arcs of capacity
1, item-to-relay arcs of capacity a_i, and a single relay-to-sink arc of capacity M.
Example
Source instance (PARTITION):
A = {2, 3, 4, 5, 6, 4} with S = 24, so M = S/2 = 12.
A valid partition is A_1 = {2, 4, 6} and A_2 = {3, 5, 4}.
Constructed target instance (IntegralFlowWithMultipliers):
- Vertices:
s, v_1, v_2, v_3, v_4, v_5, v_6, w, t (9 vertices)
- Arcs and capacities:
(s, v_i) has capacity 1 for each i = 1, ..., 6
(v_1, w): 2, (v_2, w): 3, (v_3, w): 4, (v_4, w): 5, (v_5, w): 6, (v_6, w): 4
(w, t): 12
- 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
h(w) = 1
- Requirement:
R = 12
Solution mapping:
Choose the half-sum subset {a_1, a_3, a_5} = {2, 4, 6}.
Set
f(s, v_1) = f(s, v_3) = f(s, v_5) = 1
f(s, v_2) = f(s, v_4) = f(s, v_6) = 0
Then conservation at each item vertex forces
f(v_1, w) = 2
f(v_3, w) = 4
f(v_5, w) = 6
f(v_2, w) = f(v_4, w) = f(v_6, w) = 0
At the relay, because h(w)=1, conservation gives
So the sink receives net inflow 12 = R, exactly saturating the Sahni bottleneck arc. Conversely, any feasible flow in this constructed instance must send exactly 12 units through (w, t), so it certifies a subset of {2,3,4,5,6,4} summing to 12.
References
- [Sahni, 1974]: [
Sahni1974] Sartaj Sahni (1974). "Computationally Related Problems." SIAM Journal on Computing 3(4), 262-279.
- [Karp, 1972]: [
karp1972] Richard M. Karp (1972). "Reducibility among Combinatorial Problems." In Complexity of Computer Computations, 85-103.
- [Garey and Johnson, 1979]: [
garey1979] Michael R. Garey and David S. Johnson (1979). Computers and Intractability: A Guide to the Theory of NP-Completeness.
Source: PARTITION
Target: INTEGRAL FLOW WITH MULTIPLIERS
Motivation: Establishes NP-completeness of INTEGRAL FLOW WITH MULTIPLIERS via a polynomial-time reduction from PARTITION. The reduction uses the standard vertex-multiplier gadget from Sahni's gain/loss-network construction: a unit of flow sent into item vertex
v_iis amplified to exactlya_iunits on its outgoing arc, so feasible integral flows encode subset selection. The crucial sink-side bottleneck then forces the selected subset to sum to exactly half the total, matching PARTITION rather than merely SUBSET-SUM with a lower bound.Reference: Sahni, "Computationally Related Problems," SIAM Journal on Computing 3(4):262-279, 1974, Fig. 2.2.1 (the applicable ND33 construction); catalogued as ND33 in Garey & Johnson, Computers and Intractability, p.215. Even-Itai-Shamir (1976, SIAM Journal on Computing 5(4):691-703) concerns other Garey-Johnson flow entries, not this multiplier-flow reduction.
GJ Source Entry
Reduction Algorithm
Summary:
Let the PARTITION instance be the multiset
A = {a_1, a_2, ..., a_n}of positive integers, and letS = sum_i a_i.This reduction is Sahni's 1974
sum of subsets -> N(i)construction (Fig. 2.2.1 in SIAM Journal on Computing 3(4)), specialized to the PARTITION target valueM = S/2whenSis even. The relay vertexwand the single arc(w,t)of capacityMare the load-bearing bottleneck from Sahni's figure; they are what make the sink inflow equal exactlyMunder this repository'snet_flow(t) >= Rsemantics.Odd-total preprocessing: If
Sis odd, output a fixed NO instance of INTEGRAL FLOW WITH MULTIPLIERS:s, u, t(s,u)and(u,t), both with capacity1h(u) = 2R = 1This target instance is infeasible because conservation at
urequires2 * f(s,u) = f(u,t), butf(u,t) <= 1, so the only integral possibility isf(s,u) = f(u,t) = 0, which failsR = 1. This correctly maps every odd-total PARTITION instance to NO.Even-total case: If
Sis even, letM = S/2and construct the target instance exactly in Sahni's style.Vertices: Create vertices
s,t, a relay vertexw, and item verticesv_1, v_2, ..., v_n.Arcs from the source: For each
i = 1, ..., n, add arc(s, v_i)with capacityc(s, v_i) = 1.Amplifying arcs into the relay: For each
i = 1, ..., n, add arc(v_i, w)with capacityc(v_i, w) = a_i.Single bottleneck arc into the sink: Add one arc
(w, t)with capacityc(w, t) = M.Multipliers: Set
h(v_i) = a_ifor each item vertexv_ih(w) = 1Then conservation enforces
a_i * f(s, v_i) = f(v_i, w)at eachv_if(w, t) = sum_i f(v_i, w)atwRequirement: Set
R = M.Correctness (forward): If the PARTITION instance is YES, there is a subset
I ⊆ {1, ..., n}withsum_{i in I} a_i = M. Setf(s, v_i) = 1andf(v_i, w) = a_ifori in If(s, v_i) = 0andf(v_i, w) = 0fori notin If(w, t) = MAll capacities are respected. At each
v_i, conservation holds becausea_i * f(s, v_i) = f(v_i, w). Atw, becauseh(w)=1, conservation issum_i f(v_i, w) = f(w, t) = M. Hence the sink receives net inflowM = R, so the target instance is YES.Correctness (reverse): Suppose the constructed target instance is YES. For each
i, the arc(s, v_i)has capacity1, so integrality givesf(s, v_i) in {0,1}. Conservation atv_iforcesf(v_i, w) = a_i * f(s, v_i), so each item contributes either0or exactlya_iintow. Conservation atwwithh(w)=1givesf(w, t) = sum_i a_i * f(s, v_i).The bottleneck arc
(w, t)has capacityM, sof(w, t) <= M. The sink requirement says net inflow attis at leastR = M, andthas no outgoing arcs, sof(w, t) >= M. Thereforef(w, t) = M, hencesum_i a_i * f(s, v_i) = M = S/2.The selected indices
I = { i : f(s, v_i) = 1 }therefore form a valid partition subset of exact half-sum. So the PARTITION instance is YES.Key invariant: Sahni's item vertices convert each binary source choice
f(s, v_i) in {0,1}into either0ora_iunits entering the relay. The relay vertexwwith multiplier1, together with the single bottleneck arc(w,t)of capacityS/2, turns the repository's sink conditionnet_flow(t) >= Rinto an exact-equality testnet_flow(t) = S/2.Time complexity of reduction:
O(n)time andO(n)graph size in the even branch; constant time and constant size in the odd branch.Size Overhead
Symbols:
n= number of elements in the PARTITION instanceS= total sumsum_i a_ia_max=max_i a_inum_verticesif S is even then n + 3 else 3num_arcsif S is even then 2 * n + 1 else 2max_capacityif S is even then max(a_max, S / 2) else 1requirementif S is even then S / 2 else 1Derivation: In the even branch, the construction has
nitem vertices pluss,w, andt, forn + 3total vertices. It hasnsource arcs,nitem-to-relay arcs, and one relay-to-sink bottleneck arc, for2n + 1arcs total. The odd branch returns a fixed 3-vertex, 2-arc NO instance. Thus the reduction has linear size overhead overall.Validation Method
IntegralFlowWithMultipliers, solve the target withBruteForce, extract the selected subset from the unit-capacity source arcs, and verify that the extracted subset sums to exactly half of the source total.A = {1, 2, 3, 4, 5, 5}withS = 20; the bottleneck should force sink inflow exactly10.A = {3, 5}withS = 8; without the bottleneck this was a false positive, but with Sahni's relay-and-cap construction no feasible flow can reach requirement4.A = {1, 2}withS = 3; the reduction must return the fixed NO target instance from Step 1.1, item-to-relay arcs of capacitya_i, and a single relay-to-sink arc of capacityM.Example
Source instance (PARTITION):
A = {2, 3, 4, 5, 6, 4}withS = 24, soM = S/2 = 12.A valid partition is
A_1 = {2, 4, 6}andA_2 = {3, 5, 4}.Constructed target instance (IntegralFlowWithMultipliers):
s, v_1, v_2, v_3, v_4, v_5, v_6, w, t(9 vertices)(s, v_i)has capacity1for eachi = 1, ..., 6(v_1, w): 2,(v_2, w): 3,(v_3, w): 4,(v_4, w): 5,(v_5, w): 6,(v_6, w): 4(w, t): 12h(v_1) = 2,h(v_2) = 3,h(v_3) = 4,h(v_4) = 5,h(v_5) = 6,h(v_6) = 4h(w) = 1R = 12Solution mapping:
Choose the half-sum subset
{a_1, a_3, a_5} = {2, 4, 6}.Set
f(s, v_1) = f(s, v_3) = f(s, v_5) = 1f(s, v_2) = f(s, v_4) = f(s, v_6) = 0Then conservation at each item vertex forces
f(v_1, w) = 2f(v_3, w) = 4f(v_5, w) = 6f(v_2, w) = f(v_4, w) = f(v_6, w) = 0At the relay, because
h(w)=1, conservation givesf(w, t) = 2 + 4 + 6 = 12So the sink receives net inflow
12 = R, exactly saturating the Sahni bottleneck arc. Conversely, any feasible flow in this constructed instance must send exactly12units through(w, t), so it certifies a subset of{2,3,4,5,6,4}summing to12.References
Sahni1974] Sartaj Sahni (1974). "Computationally Related Problems." SIAM Journal on Computing 3(4), 262-279.karp1972] Richard M. Karp (1972). "Reducibility among Combinatorial Problems." In Complexity of Computer Computations, 85-103.garey1979] Michael R. Garey and David S. Johnson (1979). Computers and Intractability: A Guide to the Theory of NP-Completeness.