Examples of BudgetGraphComparator


Examples of org.openfriendsbudget.helper.BudgetGraphComparator

                negatives.add(v);
                negativesDegree.put(v, degree);
            }
        }

        BudgetGraphComparator comparator = new BudgetGraphComparator();
        Graph solvedGraph = new AdjacencyMatrixDirectedGraph(graph.getVertexSet().size());
        for( Vertex v : graph.getVertexSet()) {
            solvedGraph.addVertex(v.getId());
        }

        while( (!positivesDegree.isEmpty()) && (!negativesDegree.isEmpty())) {

            // on tri les deux listes de vertex
            comparator.setTable(positivesDegree);
            Collections.sort(positives, comparator);

            comparator.setTable(negativesDegree);
            Collections.sort(negatives, comparator);
            Collections.reverse(negatives);

            Vertex maxPosV = positives.get(0);
            Vertex maxNegV = negatives.get(0);
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.