Interface MatchingAlgorithm.Matching<V,​E>

    • Method Detail

      • getGraph

        Graph<V,​E> getGraph()
        Returns the graph over which this matching is defined.
        Returns:
        the graph
      • getWeight

        double getWeight()
        Returns the weight of the matching.
        Returns:
        the weight of the matching
      • getEdges

        Set<E> getEdges()
        Get the edges of the matching.
        Returns:
        the edges of the matching
      • isMatched

        default boolean isMatched​(V v)
        Returns true if vertex v is incident to an edge in this matching.
        Parameters:
        v - vertex
        Returns:
        true if vertex v is incident to an edge in this matching.
      • isPerfect

        default boolean isPerfect()
        Returns true if the matching is a perfect matching. A matching is perfect if every vertex in the graph is incident to an edge in the matching.
        Returns:
        true if the matching is perfect. By definition, a perfect matching consists of exactly $\frac{1}{2|V|}$ edges, and the number of vertices in the graph must be even.
      • iterator

        default Iterator<E> iterator()
        Returns an iterator over the edges in the matching.
        Specified by:
        iterator in interface Iterable<V>
        Returns:
        iterator over the edges in the matching.