Package org.codehaus.plexus.graph.algorithm.util

Examples of org.codehaus.plexus.graph.algorithm.util.Label


    }

    protected boolean connectsLabels( Graph graph,
                                      Edge e )
    {
        Label first = null;
        Label second = null;

        Iterator vertices = graph.getVertices( e ).iterator();
        if ( vertices.hasNext() )
        {
            first = findLabel( (Vertex) vertices.next() );
        }
        else
        {
            return false;
        }

        if ( vertices.hasNext() )
        {
            second = findLabel( (Vertex) vertices.next() );
        }
        else
        {
            return false;
        }

        if ( vertices.hasNext() )
        {
            throw new HyperGraphException( "Unable to compute MSF on Hypergraph." );
        }

        return !first.getRoot().equals( second.getRoot() );
    }
View Full Code Here


                            Edge edge )
    {
        addEdge( edge );
        chords.remove( edge );
        Iterator vertices = graph.getVertices( edge ).iterator();
        Label prime = null;

        if ( vertices.hasNext() )
        {
            Vertex p = (Vertex) vertices.next();
            prime = findLabel( p );

            connect( edge, p );
        }

        while ( vertices.hasNext() )
        {
            Vertex v = (Vertex) vertices.next();

            Label l = findLabel( v );
            l.setRoot( prime );

            connect( edge, v );
        }

        setWeight( edge, graph.getWeight( edge ) );
View Full Code Here

        // Fill the graph we have with all the Vertexes.
        Iterator vertices = graph.getVertices().iterator();
        while ( vertices.hasNext() )
        {
            Vertex v = (Vertex) vertices.next();
            labels.put( v, new Label() );
            addVertex( v );
        }

        // Bring the edges out in the right order.
        while ( !queue.isEmpty() )
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.graph.algorithm.util.Label

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.