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 TypeMethodDescriptionbooleancontainsEdge(int edge) Check whether an edge is part of the matching.default booleancontainsEdge(Integer edge) Deprecated.edges()The collection of edges forming this matching.intgetMatchedEdge(int vertex) Get the only matched edge adjacent to a given vertex.default IntegergetMatchedEdge(Integer vertex) Deprecated.Please usegetMatchedEdge(int)instead to avoid un/boxing.booleanisVertexMatched(int vertex) Check whether a vertex is matched by the matching.default booleanisVertexMatched(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:
trueifvertexhas 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:
isVertexMatchedin interfaceMatching<Integer,Integer> - Parameters:
vertex- a vertex- Returns:
trueifvertexhas 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
vertexin the matching, or-1ifvertexis not matched
-
getMatchedEdge
Deprecated.Please usegetMatchedEdge(int)instead to avoid un/boxing.Get the only matched edge adjacent to a given vertex.- Specified by:
getMatchedEdgein interfaceMatching<Integer,Integer> - Parameters:
vertex- a vertex- Returns:
- the edge adjacent to
vertexin the matching, or-1ifvertexis not matched
-
matchedVertices
IntSet matchedVertices()Description copied from interface:MatchingGet 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:
matchedVerticesin interfaceMatching<Integer,Integer> - Returns:
- all the matched vertices
-
unmatchedVertices
IntSet unmatchedVertices()Description copied from interface:MatchingGet 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:
unmatchedVerticesin 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:
trueif 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:
containsEdgein interfaceMatching<Integer,Integer> - Parameters:
edge- an edge- Returns:
trueif the edge is part of the matching, elsefalse
-
edges
IntSet edges()Description copied from interface:MatchingThe collection of edges forming this matching.
-
containsEdge(int)instead to avoid un/boxing.