Interface IMatching
IntGraph
.
This interface is a specification of Matching
for IntGraph
. For the full documentation see
Matching
.
- Author:
- Barak Ugav
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsEdge
(int edge) Check whether an edge is part of the matching.default boolean
containsEdge
(Integer edge) Deprecated.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.Get all the vertices matched by the matching.Get all the vertices that are not matched by the matching.
-
Method Details
-
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.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.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.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
-
edges
IntSet edges()Description copied from interface:Matching
The collection of edges forming this matching.
-
containsEdge(int)
instead to avoid un/boxing.