 java.lang.Object

 org.jgrapht.alg.flow.PadbergRaoOddMinimumCutset<V,E>

 Type Parameters:
V
 the graph vertex typeE
 the graph edge type
public class PadbergRaoOddMinimumCutset<V,E> extends java.lang.Object
Implementation of the algorithm by Padberg and Rao to compute Odd Minimum CutSets. Let $G=(V,E)$ be an undirected, simple weighted graph, where all edge weights are positive. Let $T \subset V$ with $T$ even, be a set of vertices that are labelled odd. A cutset $(U:VU)$ is called odd if $T \cap U$ is an odd number. Let $c(U:VU)$ be the weight of the cut, that is, the sum of weights of the edges which have exactly one endpoint in $U$ and one endpoint in $VU$. The problem of finding an odd minimum cutset in $G$ is stated as follows: Find $W \subseteq V$ such that $c(W:VW)=min(c(U:VU)U \subseteq V, T \cap U$ is odd).The algorithm has been published in: Padberg, M. Rao, M. Odd Minimum CutSets and bMatchings. Mathematics of Operations Research, 7(1), p6780, 1982. A more concise description is published in: Letchford, A. Reinelt, G. Theis, D. Odd minimum cutsets and bmatchings revisited. SIAM Journal of Discrete Mathematics, 22(4), p14801487, 2008.
The runtime complexity of this algorithm is dominated by the runtime complexity of the algorithm used to compute A GomoryHu tree on graph $G$. Consequently, the runtime complexity of this class is $O(V^4)$.
This class does not support changes to the underlying graph. The behavior of this class is undefined when the graph is modified after instantiating this class.
 Author:
 Joris Kinable


Constructor Summary
Constructors Constructor Description PadbergRaoOddMinimumCutset(Graph<V,E> network)
Creates a new instance of the PadbergRaoOddMinimumCutset algorithm.PadbergRaoOddMinimumCutset(Graph<V,E> network, double epsilon)
Creates a new instance of the PadbergRaoOddMinimumCutset algorithm.PadbergRaoOddMinimumCutset(Graph<V,E> network, MinimumSTCutAlgorithm<V,E> minimumSTCutAlgorithm)
Creates a new instance of the PadbergRaoOddMinimumCutset algorithm.

Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calculateMinCut(java.util.Set<V> oddVertices, boolean useTreeCompression)
Calculates the minimum odd cut.java.util.Set<E>
getCutEdges()
Returns the set of edges which run from the source partition to the sink partition, in the $st$ cut obtained after the last invocation ofcalculateMinCut(Set, boolean)
java.util.Set<V>
getSinkPartition()
Returns partition $VW$ of the cut obtained after the last invocation ofcalculateMinCut(Set, boolean)
java.util.Set<V>
getSourcePartition()
Returns partition $W$ of the cut obtained after the last invocation ofcalculateMinCut(Set, boolean)
static <V> boolean
isOddVertexSet(java.util.Set<V> vertices, java.util.Set<V> oddVertices)
Convenience method which test whether the given set contains an odd number of oddlabeled nodes.



Constructor Detail

PadbergRaoOddMinimumCutset
public PadbergRaoOddMinimumCutset(Graph<V,E> network)
Creates a new instance of the PadbergRaoOddMinimumCutset algorithm. Parameters:
network
 input graph

PadbergRaoOddMinimumCutset
public PadbergRaoOddMinimumCutset(Graph<V,E> network, double epsilon)
Creates a new instance of the PadbergRaoOddMinimumCutset algorithm. Parameters:
network
 input graphepsilon
 tolerance

PadbergRaoOddMinimumCutset
public PadbergRaoOddMinimumCutset(Graph<V,E> network, MinimumSTCutAlgorithm<V,E> minimumSTCutAlgorithm)
Creates a new instance of the PadbergRaoOddMinimumCutset algorithm. Parameters:
network
 input graphminimumSTCutAlgorithm
 algorithm used to calculate the GomoryHu tree


Method Detail

calculateMinCut
public double calculateMinCut(java.util.Set<V> oddVertices, boolean useTreeCompression)
Calculates the minimum odd cut. The implementation follows Algorithm 1 in the paper Odd minimum cut sets and bmatchings revisited by Adam Letchford, Gerhard Reinelt and Dirk Theis. The original algorithm runs on a compressed GomoryHu tree: a cuttree with the odd vertices as terminal vertices. This tree has $T1$ edges as opposed to $V1$ for a GomoryHu tree defined on the input graph $G$. This compression step can however be skipped. If you want to run the original algorithm in the paper, set the parameteruseTreeCompression
to true. Alternatively, experiment which setting of this parameter produces the fastest results. Both settings are guaranteed to find the optimal cut. Experiments on random graphs showed that settinguseTreeCompression
to false was on average a bit faster. Parameters:
oddVertices
 Set of vertices which are labeled 'odd'. Note that the number of vertices in this set must be even!useTreeCompression
 parameter indicating whether tree compression should be used (recommended: false). Returns:
 weight of the minimum odd cut.

isOddVertexSet
public static <V> boolean isOddVertexSet(java.util.Set<V> vertices, java.util.Set<V> oddVertices)
Convenience method which test whether the given set contains an odd number of oddlabeled nodes. Type Parameters:
V
 vertex type Parameters:
vertices
 input setoddVertices
 subset of vertices which are labeled odd Returns:
 true if the given set contains an odd number of oddlabeled nodes.

getSourcePartition
public java.util.Set<V> getSourcePartition()
Returns partition $W$ of the cut obtained after the last invocation ofcalculateMinCut(Set, boolean)
 Returns:
 partition $W$

getSinkPartition
public java.util.Set<V> getSinkPartition()
Returns partition $VW$ of the cut obtained after the last invocation ofcalculateMinCut(Set, boolean)
 Returns:
 partition $VW$

getCutEdges
public java.util.Set<E> getCutEdges()
Returns the set of edges which run from the source partition to the sink partition, in the $st$ cut obtained after the last invocation ofcalculateMinCut(Set, boolean)
 Returns:
 set of edges which have one endpoint in the source partition and one endpoint in the sink partition.

