Interface IMatching

    • 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 if vertex has an adjacent edge in the matching, else false
      • isVertexMatched

        @Deprecated
        default boolean isVertexMatched​(Integer vertex)
        Deprecated.
        Please use isVertexMatched(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 interface Matching<Integer,​Integer>
        Parameters:
        vertex - a vertex
        Returns:
        true if vertex has an adjacent edge in the matching, else false
      • 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 if vertex 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 interface Matching<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 interface Matching<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, else false
      • containsEdge

        @Deprecated
        default boolean containsEdge​(Integer edge)
        Deprecated.
        Please use containsEdge(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 interface Matching<Integer,​Integer>
        Parameters:
        edge - an edge
        Returns:
        true if the edge is part of the matching, else false
      • edges

        IntSet edges()
        Description copied from interface: Matching
        The collection of edges forming this matching.
        Specified by:
        edges in interface Matching<Integer,​Integer>
        Returns:
        collection containing all the edges that are part of this matching