Package de.timefinder.algo.graph

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


    @Test
    public void testAddEdge() {
        System.out.println("addEdge");

        Matching instance = new Matching();
        instance.addEdge(3, 4, 5.6f);
        instance.addEdge(3, 4, 7f);
        instance.addEdge(0, 5, 5.6f);

        assertEquals(2, instance.getEdges().size());
View Full Code Here


    public void testAddEdge() {
        System.out.println("addEdge");

        Matching instance = new Matching();
        instance.addEdge(3, 4, 5.6f);
        instance.addEdge(3, 4, 7f);
        instance.addEdge(0, 5, 5.6f);

        assertEquals(2, instance.getEdges().size());

        assertEquals(11.2f, instance.getTotalSum(), 0.01f);
View Full Code Here

        System.out.println("addEdge");

        Matching instance = new Matching();
        instance.addEdge(3, 4, 5.6f);
        instance.addEdge(3, 4, 7f);
        instance.addEdge(0, 5, 5.6f);

        assertEquals(2, instance.getEdges().size());

        assertEquals(11.2f, instance.getTotalSum(), 0.01f);
    }
View Full Code Here

    @Test
    public void testToBipartiteArray() {
        System.out.println("toBipartiteArray");

        Matching instance = new Matching();
        instance.addEdge(0, 4 + 2, 5.6f);
        instance.addEdge(1, 4 + 3, 5.6f);
        instance.addEdge(3, 4 + 1, 5.6f);

        int[][] result = instance.toBipartiteArrayModY(4);
        assertEquals(2, result[0][0]);
View Full Code Here

    public void testToBipartiteArray() {
        System.out.println("toBipartiteArray");

        Matching instance = new Matching();
        instance.addEdge(0, 4 + 2, 5.6f);
        instance.addEdge(1, 4 + 3, 5.6f);
        instance.addEdge(3, 4 + 1, 5.6f);

        int[][] result = instance.toBipartiteArrayModY(4);
        assertEquals(2, result[0][0]);
        assertEquals(3, result[1][0]);
View Full Code Here

        System.out.println("toBipartiteArray");

        Matching instance = new Matching();
        instance.addEdge(0, 4 + 2, 5.6f);
        instance.addEdge(1, 4 + 3, 5.6f);
        instance.addEdge(3, 4 + 1, 5.6f);

        int[][] result = instance.toBipartiteArrayModY(4);
        assertEquals(2, result[0][0]);
        assertEquals(3, result[1][0]);
        assertEquals(null, result[2]);
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.