Module org.jgrapht.core
Package org.jgrapht.generate.netgen
Class BipartiteMatchingProblem.BipartiteMatchingProblemImpl<V,E>
java.lang.Object
org.jgrapht.generate.netgen.BipartiteMatchingProblem.BipartiteMatchingProblemImpl<V,E>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
BipartiteMatchingProblem<V,
E>
- Enclosing interface:
- BipartiteMatchingProblem<V,
E>
public static class BipartiteMatchingProblem.BipartiteMatchingProblemImpl<V,E>
extends Object
implements BipartiteMatchingProblem<V,E>
Default implementation of a Bipartite Matching Problem
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapht.generate.netgen.BipartiteMatchingProblem
BipartiteMatchingProblem.BipartiteMatchingProblemImpl<V,
E> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCosts()
Returns a cost function of this problem.getGraph()
Returns the graph, which defines the problemReturns one of the 2 partitions of the graph (no 2 vertices in this set share an edge)Returns one of the 2 partitions of the graph (no 2 vertices in this set share an edge)boolean
Determines if this problem is weighted or not.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jgrapht.generate.netgen.BipartiteMatchingProblem
dumpCosts
-
Constructor Details
-
BipartiteMatchingProblemImpl
public BipartiteMatchingProblemImpl(Graph<V, E> graph, Set<V> partition1, Set<V> partition2, Function<E, Double> costs, boolean weighted) Constructs a new bipartite matching problem- Parameters:
graph
- a graph, which defines the problempartition1
- one of the partitions of the graphpartition2
- one of the partitions of the graphcosts
- problem cost functionweighted
- is the problem is weighted or not
-
-
Method Details
-
getGraph
Returns the graph, which defines the problem- Specified by:
getGraph
in interfaceBipartiteMatchingProblem<V,
E> - Returns:
- the graph, which defines the problem
-
getCosts
Returns a cost function of this problem. This function must be defined for all edges of the graph. In the case the problem is unweighted, the function must return any constant value for all edges.- Specified by:
getCosts
in interfaceBipartiteMatchingProblem<V,
E> - Returns:
- a cost function of this problem
-
getPartition1
Returns one of the 2 partitions of the graph (no 2 vertices in this set share an edge)- Specified by:
getPartition1
in interfaceBipartiteMatchingProblem<V,
E> - Returns:
- one of the 2 partitions of the graph
-
getPartition2
Returns one of the 2 partitions of the graph (no 2 vertices in this set share an edge)- Specified by:
getPartition2
in interfaceBipartiteMatchingProblem<V,
E> - Returns:
- one of the 2 partitions of the graph
-
isWeighted
public boolean isWeighted()Determines if this problem is weighted or not.- Specified by:
isWeighted
in interfaceBipartiteMatchingProblem<V,
E> - Returns:
true
is the problem is weighted,false
otherwise
-