Package org.openjgraph.model.adjacencymatrix

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


            AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addVertex("D");
            graph.addEdge("A", "B", 5);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 10);

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


            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addVertex("D");
            graph.addEdge("A", "B", 5);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 10);

            Set<Edge> edgeSet = graph.getEdge("A");
            assertEquals(2,edgeSet.size());
            assertTrue(edgeSet.contains(new AdjacencyMatrixEdge(graph,"A", "B")));
View Full Code Here

            graph.addVertex("B");
            graph.addVertex("C");
            graph.addVertex("D");
            graph.addEdge("A", "B", 5);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 10);

            Set<Edge> edgeSet = graph.getEdge("A");
            assertEquals(2,edgeSet.size());
            assertTrue(edgeSet.contains(new AdjacencyMatrixEdge(graph,"A", "B")));
            assertTrue(edgeSet.contains(new AdjacencyMatrixEdge(graph,"A", "C")));
View Full Code Here

        try {
            AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addEdge("A", "B", 5);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 10);

            assertEquals(5, graph.getEdgeValue("A", "B"));
            assertEquals(4, graph.getEdgeValue("A", "C"));
View Full Code Here

            AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addEdge("A", "B", 5);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 10);

            assertEquals(5, graph.getEdgeValue("A", "B"));
            assertEquals(4, graph.getEdgeValue("A", "C"));
            assertEquals(10, graph.getEdgeValue("B", "C"));
View Full Code Here

            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addEdge("A", "B", 5);
            graph.addEdge("A", "C", 4);
            graph.addEdge("B", "C", 10);

            assertEquals(5, graph.getEdgeValue("A", "B"));
            assertEquals(4, graph.getEdgeValue("A", "C"));
            assertEquals(10, graph.getEdgeValue("B", "C"));
View Full Code Here

        try {
            AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addEdge("A", "B");
            graph.addEdge("A", "C", 4);
            AdjacencyMatrixEdge e1 = new AdjacencyMatrixEdge(graph, "A", "B");
            AdjacencyMatrixEdge e2 = new AdjacencyMatrixEdge(graph, "A", "C");
            assertEquals("A -[1]- B", e1.toString());
            assertEquals("A -[4]- C", e2.toString());
View Full Code Here

            AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addEdge("A", "B");
            graph.addEdge("A", "C", 4);
            AdjacencyMatrixEdge e1 = new AdjacencyMatrixEdge(graph, "A", "B");
            AdjacencyMatrixEdge e2 = new AdjacencyMatrixEdge(graph, "A", "C");
            assertEquals("A -[1]- B", e1.toString());
            assertEquals("A -[4]- C", e2.toString());
View Full Code Here

            AdjacencyMatrixVertex v4 = new AdjacencyMatrixVertex(graph, "D");
            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addVertex("D");
            graph.addEdge("A", "B");
            graph.addEdge("A", "C");

            Set<Edge> edgeSet = v1.getEdges();
            assertEquals(2, edgeSet.size());
View Full Code Here

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

            Set<Edge> edgeSet = v1.getEdges();
            assertEquals(2, edgeSet.size());

            boolean containsV2 = 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.