Package graph.model

Examples of graph.model.Vertex


        return notVisitedEdges;
    }

    public void sendAnt(Graph graph, Ant ant) {
        Vertex startingVertex = graph.getRandomVertex();
        int numberOfVertices = graph.getVertices().size();
        List<Vertex> visitedVertex = null;
        int size = 0;

        while (size + 1 < numberOfVertices) {
            Vertex chosenVertex = chosePath(startingVertex, graph, ant);
            ant.addVisitedVertex(startingVertex);
            ant.addToTour(graph.getEdgeBetweenToVertices(startingVertex, chosenVertex).getWeight());
            ant.addEdge(graph.getEdgeBetweenToVertices(startingVertex, chosenVertex));
            startingVertex = chosenVertex;
View Full Code Here


       
        int maximalIndexValue = searchMaximumVertexIndex(input);

        for (int i = 0; i < maximalIndexValue; i++) {
           
            Vertex v = new DirectedVertex(i);
            vertices.add(v);
        }

        int i = 0;
        for (List<Integer> line : input) {
View Full Code Here

TOP

Related Classes of graph.model.Vertex

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.