Package com.jgalgo.alg
Interface IMatching
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description boolean
containsEdge(int edge)
Check whether an edge is part of the matching.default boolean
containsEdge(Integer edge)
Deprecated.Please usecontainsEdge(int)
instead to avoid un/boxing.IntSet
edges()
The collection of edges forming this matching.int
getMatchedEdge(int vertex)
Get the only matched edge adjacent to a given vertex.default Integer
getMatchedEdge(Integer vertex)
Deprecated.Please usegetMatchedEdge(int)
instead to avoid un/boxing.boolean
isVertexMatched(int vertex)
Check whether a vertex is matched by the matching.default boolean
isVertexMatched(Integer vertex)
Deprecated.Please useisVertexMatched(int)
instead to avoid un/boxing.IntSet
matchedVertices()
Get all the vertices matched by the matching.IntSet
unmatchedVertices()
Get all the vertices that are not matched by the matching.
-
-
-
Method Detail
-
isVertexMatched
boolean isVertexMatched(int vertex)
Check whether a vertex is matched by the matching.A vertex \(v\) is said to be matched if the matching contains an edge \((v,w)\) for some other vertex \(w\).
- Parameters:
vertex
- a vertex- Returns:
true
ifvertex
has an adjacent edge in the matching, elsefalse
-
isVertexMatched
@Deprecated default boolean isVertexMatched(Integer vertex)
Deprecated.Please useisVertexMatched(int)
instead to avoid un/boxing.Check whether a vertex is matched by the matching.A vertex \(v\) is said to be matched if the matching contains an edge \((v,w)\) for some other vertex \(w\).
- Specified by:
isVertexMatched
in interfaceMatching<Integer,Integer>
- Parameters:
vertex
- a vertex- Returns:
true
ifvertex
has an adjacent edge in the matching, elsefalse
-
getMatchedEdge
int getMatchedEdge(int vertex)
Get the only matched edge adjacent to a given vertex.- Parameters:
vertex
- a vertex- Returns:
- the edge adjacent to
vertex
in the matching, or-1
ifvertex
is not matched
-
getMatchedEdge
@Deprecated default Integer getMatchedEdge(Integer vertex)
Deprecated.Please usegetMatchedEdge(int)
instead to avoid un/boxing.Get the only matched edge adjacent to a given vertex.- Specified by:
getMatchedEdge
in interfaceMatching<Integer,Integer>
- Parameters:
vertex
- a vertex- Returns:
- the edge adjacent to
vertex
in the matching, or-1
ifvertex
is not matched
-
matchedVertices
IntSet matchedVertices()
Description copied from interface:Matching
Get all the vertices matched by the matching.A vertex \(v\) is said to be matched if the matching contains an edge \((v,w)\) for some other vertex \(w\).
- Specified by:
matchedVertices
in interfaceMatching<Integer,Integer>
- Returns:
- all the matched vertices
-
unmatchedVertices
IntSet unmatchedVertices()
Description copied from interface:Matching
Get all the vertices that are not matched by the matching.A vertex \(v\) is said to be matched if the matching contains an edge \((v,w)\) for some other vertex \(w\).
- Specified by:
unmatchedVertices
in interfaceMatching<Integer,Integer>
- Returns:
- all the unmatched vertices
-
containsEdge
boolean containsEdge(int edge)
Check whether an edge is part of the matching.A matching \(M\) is a sub set of \(E\), the edge set of the graph. This method check whether a given edge is in \(M\).
- Parameters:
edge
- an edge- Returns:
true
if the edge is part of the matching, elsefalse
-
containsEdge
@Deprecated default boolean containsEdge(Integer edge)
Deprecated.Please usecontainsEdge(int)
instead to avoid un/boxing.Check whether an edge is part of the matching.A matching \(M\) is a sub set of \(E\), the edge set of the graph. This method check whether a given edge is in \(M\).
- Specified by:
containsEdge
in interfaceMatching<Integer,Integer>
- Parameters:
edge
- an edge- Returns:
true
if the edge is part of the matching, elsefalse
-
-