Interface BipartiteMatchingProblem<V,E>
- Type Parameters:
V- the graph vertex typesE- the graph edge type
- All Known Implementing Classes:
BipartiteMatchingProblem.BipartiteMatchingProblemImpl
isWeighted().
The minimum weight (minimum cost) perfect bipartite matching problem is defined as follows: \[ \begin{align} \mbox{minimize}~& \sum_{e \in E}c_e\cdot x_e &\\ \mbox{s.t. }&\sum_{e\in \delta(v)} x_e = 1 & \forall v\in V\\ &x_e \in \{0,1\} & \forall e\in E \end{align} \] Here $\delta(v)$ denotes the set of edges incident to the vertex $v$. The parameters $c_{e}$ define a cost of adding the edge $e$ to the matching. If the problem is unweighted, the values $c_e$ are equal to 1 in the problem formulation.
This class can define bipartite matching problems without the requirement that every edge must be matched, i.e. non-perfect matching problems. These problems are called maximum cardinality bipartite matching problems. The goal of the maximum cardinality matching problem is to find a matching with maximum number of edges. If the cost function is used in this setup, the goal is to find the cheapest matching among all matchings of maximum cardinality.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDefault implementation of a Bipartite Matching Problem -
Method Summary
Modifier and TypeMethodDescriptiondefault voidDumps the problem edge costs to the underlying graph.getCosts()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)booleanDetermines if this problem is weighted or not.
-
Method Details
-
getGraph
-
getPartition1
-
getPartition2
-
getCosts
-
isWeighted
boolean isWeighted()Determines if this problem is weighted or not.- Returns:
trueis the problem is weighted,falseotherwise
-
dumpCosts
default void dumpCosts()Dumps the problem edge costs to the underlying graph.
-