Use nonnegative amounts on the original directed edges of the flow network. A feasible flow is a function satisfying the capacity constraints and flow conservation at every internal vertex:Its flow value is net outflow at the source,Summing flow conservation shows that this is also net inflow at the sink. Subtracting incoming flow matters when the source has incoming edges.
An – cut of a flow network is a partition of a set with and . Its cut capacity is the total outward flow network edge capacity,Incoming edges do not contribute to this sum. Equivalently, one may use the antisymmetric net-flow convention, but the nonnegative arc convention above will also be used in the subsequent reductions.
Sum net outflow over all vertices in the source side . An internal directed edge occurs once positively and once negatively, so it cancels. All internal vertices have zero net outflow by flow conservation, and the sink is outside . ThereforeThe second sum is nonnegative, while every term in the first satisfies its capacity constraint. Consequently,This is direct accounting from flow conservation; it does not invoke the max-flow min-cut theorem.
A path-cycle matching is exactly an edge subset whose resulting subgraph has maximum degree at most two: every nontrivial connected component of a graph of this form is a graph path or a cycle in a graph. Thus the task is a bipartite b-matching problem with bound two at every vertex.
Find a bipartition , orient every original edge from to , and add a source and sink . Give each arc , for , flow network edge capacity two; each original arc flow network edge capacity one; and each arc , for , flow network edge capacity two. Compute an integral maximum flow and select the original edges whose flow is one. The integral max-flow theorem guarantees such an integral optimum.
By flow conservation, at most two selected edges touch each vertex, so they decompose into the required vertex-disjoint paths and cycles in a graph. Conversely, any permissible path-cycle matching gives a feasible flow: send one unit through its middle arc for each selected edge, with the outside arc amounts equal to the endpoint degrees. In both directions, the flow value equals the number of selected edges. Maximizing either quantity therefore maximizes the other.
The blue edges in this example form a four-cycle in a graph and a one-edge graph path; the dashed edge is unused. Their five units of flow are optimal: the two left vertices can each contribute at most two selected edges, and has only one incident edge.
The constructed flow network has vertices and arcs. A polynomial-time algorithm for maximum flow, such as the Edmonds–Karp algorithm, followed by a traversal of the selected subgraph, gives an efficient solution.
Separate the forced integer portion from the choice of rounding direction. Put and . Define residual demandsThese are nonnegative integers, since the original row and column sums are integers. Also . Each fractional part satisfies .
Construct a flow network with a vertex for each row and column, source-to-row arcs of flow network edge capacity , row-to-column arcs of flow network edge capacity one exactly where , and column-to-sink arcs of flow network edge capacity . The amounts themselves define a fractional feasible flow of flow value . No flow can exceed , the total source flow network edge capacity. Because all constructed flow network edge capacities are integers, an integral maximum flow also has flow value and saturates every source and sink arc.
Let be its middle-arc flow, taking when that arc is absent. Then , and the required answer isAt an already integral entry no middle arc exists, so that entry stays fixed. At a nonintegral entry the two possibilities are precisely its floor and ceiling. Flow conservation gives and , preserving every original row and column sum.
This is matrix rounding with fixed margins. There are vertices and at most arcs. Exact rational arithmetic computes the floors and residual demands in polynomial time in the encoded input length; the resulting flow network edge capacities are small integers, so there is no need to scale by a potentially large common denominator.
First give the vote of every voter whose allowed set contains . Let their number be . This loses no possible strict victory: starting with any winning assignment, changing such a ballot to increases 's score and weakly decreases an opponent's score. Thus a winning assignment exists exactly when one exists with these ballots fixed.
Every remaining voter must now be assigned to an allowed opponent, and each opponent may receive at most votes. If any allowed set is empty, there is no valid election assignment. With at least two candidates, immediately makes a unique victory impossible. With only the candidate , every nonempty ballot set forces that candidate, so the answer is yes under the question's strict-comparison definition.
For the remaining case , make a flow network with a vertex for each remaining voter and each opponent. Add source-to-voter arcs of flow network edge capacity one, voter-to-opponent arcs of flow network edge capacity one for the allowed choices, and opponent-to-sink arcs of flow network edge capacity . Compute an integral maximum flow. ThenA flow saturating all voter arcs assigns each remaining voter to exactly one allowed opponent, by integrality and flow conservation. The sink-arc capacity constraints give every opponent strictly fewer than votes. Conversely, any winning assignment with the fixed votes defines just such a saturating feasible flow. The flow network has at most vertices and arcs, hence the decision takes polynomial time.
Articles by others on the same topic
There are currently no matching articles.
