Package de.timefinder.algo.graph

Examples of de.timefinder.algo.graph.WeightedGraph.addEdge()


    public void testGetOneNodeWithAnEdge() {
        System.out.println("getOneNodeWithAnEdge");
        WeightedGraph graph = new WeightedGraph(10);
        graph.addEdge(3, 4, 7f);
        graph.addEdge(3, 4, 7f);
        graph.addEdge(2, 4, 7f);

        assertTrue(graph.getOneNodeWithAnEdge() != -1);

        graph.removeEdge(3, 4);
        assertTrue(graph.getOneNodeWithAnEdge() != -1);
View Full Code Here


     */
    @Test
    public void testRemoveNodeAndNeighbors() {
        System.out.println("removeNodeAndNeighbors");
        WeightedGraph graph = new WeightedGraph(10);
        graph.addEdge(3, 4, 7f);
        graph.addEdge(1, 5, 7f);
        graph.addEdge(2, 4, 7f);

        assertTrue(graph.removeNodeAndNeighbors(4));

View Full Code Here

    @Test
    public void testRemoveNodeAndNeighbors() {
        System.out.println("removeNodeAndNeighbors");
        WeightedGraph graph = new WeightedGraph(10);
        graph.addEdge(3, 4, 7f);
        graph.addEdge(1, 5, 7f);
        graph.addEdge(2, 4, 7f);

        assertTrue(graph.removeNodeAndNeighbors(4));

        assertEquals(graph.getNoOfEdges(), 1);
View Full Code Here

    public void testRemoveNodeAndNeighbors() {
        System.out.println("removeNodeAndNeighbors");
        WeightedGraph graph = new WeightedGraph(10);
        graph.addEdge(3, 4, 7f);
        graph.addEdge(1, 5, 7f);
        graph.addEdge(2, 4, 7f);

        assertTrue(graph.removeNodeAndNeighbors(4));

        assertEquals(graph.getNoOfEdges(), 1);
        assertTrue(graph.getOneNodeWithAnEdge() != -1);
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.