app/src/main/java/org/jgrapht/alg/EdmondsBlossomShrinking.java
private Set<E> findMatch()
    {
        Set<E> result = new ArrayUnenforcedSet<E>();
        match = new HashMap<V, V>();
        p = new HashMap<V, V>();
        q = new ArrayDeque<V>();
        base = new HashMap<V, V>();
        used = new HashSet<V>();
        blossom = new HashSet<V>();

        for (V i : graph.vertexSet()) {
            if (!match.containsKey(i)) {
                V v = findPath(i);
                while (v != null) {
                    V pv = p.get(v);
                    V ppv = match.get(pv);
                    match.put(v, pv);
                    match.put(pv, v);
                    v = ppv;
                }
            }
        }

        Set<V> seen = new HashSet<V>();
        for (V v : graph.vertexSet()) {
            if (!seen.contains(v) && match.containsKey(v)) {
                seen.add(v);
                seen.add(match.get(v));
                result.add(graph.getEdge(v, match.get(v)));
            }
        }

        return result;
    }
/**
     * Runs the algorithm on the input graph and returns the match edge set.
     *
     * @return set of Edges
     */
Runs the algorithm on the input graph and returns the match edge set.
@return set of Edges
Runs the algorithm on the input graph and returns the match edge set . @return set of Edges
private Set<E> findMatch()
    {
        Set<E> result = new ArrayUnenforcedSet<E>();
        match = new HashMap<V, V>();
        p = new HashMap<V, V>();
        q = new ArrayDeque<V>();
        base = new HashMap<V, V>();
        used = new HashSet<V>();
        blossom = new HashSet<V>();
        for (V i : graph.vertexSet()) {
            if (!match.containsKey(i)) {
                V v = findPath(i);
                while (v != null) {
                    V pv = p.get(v);
                    V ppv = match.get(pv);
                    match.put(v, pv);
                    match.put(pv, v);
                    v = ppv;
                }
            }
        }
        Set<V> seen = new HashSet<V>();
        for (V v : graph.vertexSet()) {
            if (!seen.contains(v) && match.containsKey(v)) {
                seen.add(v);
                seen.add(match.get(v));
                result.add(graph.getEdge(v, match.get(v)));
            }
        }
        return result;
    }
private Set < E > findMatch ( ) { Set < E > result = new ArrayUnenforcedSet < E > ( ) ; match = new HashMap < V , V > ( ) ; p = new HashMap < V , V > ( ) ; q = new ArrayDeque < V > ( ) ; base = new HashMap < V , V > ( ) ; used = new HashSet < V > ( ) ; blossom = new HashSet < V > ( ) ; for ( V i : graph . vertexSet ( ) ) { if ( ! match . containsKey ( i ) ) { V v = findPath ( i ) ; while ( v != null ) { V pv = p . get ( v ) ; V ppv = match . get ( pv ) ; match . put ( v , pv ) ; match . put ( pv , v ) ; v = ppv ; } } } Set < V > seen = new HashSet < V > ( ) ; for ( V v : graph . vertexSet ( ) ) { if ( ! seen . contains ( v ) && match . containsKey ( v ) ) { seen . add ( v ) ; seen . add ( match . get ( v ) ) ; result . add ( graph . getEdge ( v , match . get ( v ) ) ) ; } } return result ; }
Runs the algorithm on the input graph and returns the match edge set.
Runs the algorithm on the input graph and returns the match edge set .