public class KuhnMunkresMinimalWeightBipartitePerfectMatching<V,E> extends Object implements WeightedMatchingAlgorithm<V,E>
Assignment problem could be set as follows:
Given complete bipartite graph G = (S, T; E), such that |S| = |T|, and each edge has non-negative cost c(i, j), find perfect matching of minimal cost.
Modifier and Type | Class and Description |
---|---|
protected static class |
KuhnMunkresMinimalWeightBipartitePerfectMatching.KuhnMunkresMatrixImplementation<V,E>
...
|
Constructor and Description |
---|
KuhnMunkresMinimalWeightBipartitePerfectMatching(WeightedGraph<V,E> G,
List<? extends V> S,
List<? extends V> T) |
Modifier and Type | Method and Description |
---|---|
Set<E> |
getMatching()
Returns set of edges making up the matching
|
double |
getMatchingWeight()
Returns weight of a matching found
|
public KuhnMunkresMinimalWeightBipartitePerfectMatching(WeightedGraph<V,E> G, List<? extends V> S, List<? extends V> T)
G
- target weighted bipartite graph to find matching inS
- first vertex partition of the target bipartite graphT
- second vertex partition of the target bipartite graphpublic Set<E> getMatching()
MatchingAlgorithm
getMatching
in interface MatchingAlgorithm<V,E>
public double getMatchingWeight()
WeightedMatchingAlgorithm
getMatchingWeight
in interface WeightedMatchingAlgorithm<V,E>
Copyright © 2016. All rights reserved.