Package org.openjgraph.model.adjacencymatrix

Examples of org.openjgraph.model.adjacencymatrix.AdjacencyMatrixGraph.addEdge()


        try {
            graph.addEdge("A", "B");
            graph.addEdge("A", "C");
            graph.addEdge("B", "C");
            graph.addEdge("B", "D");

            Set<Vertex> vertexSet2 = graph.getVertexSet();
            for( Vertex v : vertexSet2 ) {
                String vId = v.getId();
                assertTrue("un sommet inconnu a été trouvé",(("A".equals(vId)) || ("B".equals(vId)) || ("C".equals(vId)) ||("D".equals(vId)) ||("E".equals(vId)) ));
View Full Code Here


        vertexSet.add("E");

        AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph(2);
        graph.setVertex(vertexSet);
        try {
            graph.addEdge("A", "B", 2);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 6);
            graph.addEdge("B", "D", 1);

            Set<Edge> setA = graph.getEdgeSet("A");
View Full Code Here

        AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph(2);
        graph.setVertex(vertexSet);
        try {
            graph.addEdge("A", "B", 2);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 6);
            graph.addEdge("B", "D", 1);

            Set<Edge> setA = graph.getEdgeSet("A");
            assertEquals(2, setA.size());
View Full Code Here

        AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph(2);
        graph.setVertex(vertexSet);
        try {
            graph.addEdge("A", "B", 2);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 6);
            graph.addEdge("B", "D", 1);

            Set<Edge> setA = graph.getEdgeSet("A");
            assertEquals(2, setA.size());
            for( Edge e : setA) {
View Full Code Here

        graph.setVertex(vertexSet);
        try {
            graph.addEdge("A", "B", 2);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 6);
            graph.addEdge("B", "D", 1);

            Set<Edge> setA = graph.getEdgeSet("A");
            assertEquals(2, setA.size());
            for( Edge e : setA) {
                assertEquals(2, e.getVertex().size());
View Full Code Here

        graph.setVertex(vertexSet);

        for( int i = 0; i < 10; i++) {
            for( int j = 0; j < i; j++) {
                try {
                    graph.addEdge(Integer.toString(i), Integer.toString(i), 1);
                } catch (VertexNotFoundException ex) {
                    assertTrue("Impossible d'ajouter l'arete (" + i + "," + j +")",false);
                }
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.