org.jgrapht.alg.matching
Class MaximumWeightBipartiteMatching<V,E>
- java.lang.Object
-
- org.jgrapht.alg.matching.MaximumWeightBipartiteMatching<V,E>
-
- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Implemented Interfaces:
- MatchingAlgorithm<V,E>
public class MaximumWeightBipartiteMatching<V,E> extends java.lang.Object implements MatchingAlgorithm<V,E>
This class finds a maximum weight matching of a simple undirected weighted bipartite graph. The algorithm runs in O(V|E|^2). The algorithm is described in The LEDA Platform of Combinatorial and Geometric Computing, Cambridge University Press, 1999. https://people.mpi-inf.mpg.de/~mehlhorn/LEDAbook.html Note: the input graph must be bipartite with positive integer edge weights
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jgrapht.alg.interfaces.MatchingAlgorithm
MatchingAlgorithm.Matching<E>, MatchingAlgorithm.MatchingImpl<E>
-
-
Field Summary
-
Fields inherited from interface org.jgrapht.alg.interfaces.MatchingAlgorithm
DEFAULT_EPSILON
-
-
Constructor Summary
Constructors Constructor and Description MaximumWeightBipartiteMatching(Graph<V,E> graph, java.util.Set<V> partition1, java.util.Set<V> partition2)Construct a new instance of the algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description MatchingAlgorithm.Matching<E>computeMatching()Compute a matching for a given graph.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jgrapht.alg.interfaces.MatchingAlgorithm
getMatching
-
-
-
-
Constructor Detail
-
MaximumWeightBipartiteMatching
public MaximumWeightBipartiteMatching(Graph<V,E> graph, java.util.Set<V> partition1, java.util.Set<V> partition2)
Construct a new instance of the algorithm. Supported graphs are simple undirected weighted bipartite with positive integer edge weights.- Parameters:
graph- the input graphpartition1- the first partition of the vertex setpartition2- the second partition of the vertex set- Throws:
java.lang.IllegalArgumentException- if the graph is not undirected
-
-
Method Detail
-
computeMatching
public MatchingAlgorithm.Matching<E> computeMatching()
Compute a matching for a given graph.- Specified by:
computeMatchingin interfaceMatchingAlgorithm<V,E>- Returns:
- a matching
-
-
DataMelt 3.0 © DataMelt by jWork.ORG