Examples of PathCounter


Examples of org.neo4j.graphalgo.impl.shortestpath.Util.PathCounter

        // Extract predecessors and successors
        Map<Node,List<Relationship>> predecessors = singleSourceShortestPath
            .getPredecessors();
        Map<Node,List<Relationship>> successors = Util
            .reversedPredecessors( predecessors );
        PathCounter counter = new Util.PathCounter( predecessors );
        // Recursively update the node dependencies
        getAndUpdateNodeStress( node, true, successors, counter,
            new HashMap<Node,Double>() );
    }
View Full Code Here

Examples of org.neo4j.graphalgo.impl.shortestpath.Util.PathCounter

        // Extract predecessors and successors
        Map<Node,List<Relationship>> predecessors = singleSourceShortestPath
            .getPredecessors();
        Map<Node,List<Relationship>> successors = Util
            .reversedPredecessors( predecessors );
        PathCounter counter = new Util.PathCounter( predecessors );
        // Recursively update the node dependencies
        getAndUpdateNodeDependency( node, true, successors, counter,
            new HashMap<Node,Double>() );
    }
View Full Code Here

Examples of org.neo4j.graphalgo.impl.shortestpath.Util.PathCounter

            singleSourceShortestPath.setStartNode( startNode );
            Map<Node,List<Relationship>> predecessors = singleSourceShortestPath
                .getPredecessors();
            Map<Node,List<Relationship>> successors = Util
                .reversedPredecessors( predecessors );
            PathCounter counter = new Util.PathCounter( predecessors );
            // Recursively update the node dependencies
            getAndUpdateNodeDependency( startNode, true, successors, counter,
                new HashMap<Node,Double>() );
            Double adjustment = 0.5; // since direction is BOTH
            assertCentrality( this, "a", 0.0 * adjustment );
View Full Code Here

Examples of org.neo4j.graphalgo.impl.shortestpath.Util.PathCounter

        ep.add( e.createRelationshipTo( d, MyRelTypes.R1 ) );
        dp.add( d.createRelationshipTo( a, MyRelTypes.R1 ) );
        cp.add( c.createRelationshipTo( b, MyRelTypes.R1 ) );
        bp.add( b.createRelationshipTo( a, MyRelTypes.R1 ) );
        // Count
        PathCounter counter = new Util.PathCounter( predecessors );
        assertTrue( counter.getNumberOfPathsToNode( a ) == 1 );
        assertTrue( counter.getNumberOfPathsToNode( b ) == 1 );
        assertTrue( counter.getNumberOfPathsToNode( c ) == 1 );
        assertTrue( counter.getNumberOfPathsToNode( d ) == 1 );
        assertTrue( counter.getNumberOfPathsToNode( e ) == 2 );
        assertTrue( counter.getNumberOfPathsToNode( f ) == 3 );
        // Reverse
        counter = new Util.PathCounter( Util.reversedPredecessors( predecessors ));
        assertTrue( counter.getNumberOfPathsToNode( a ) == 3 );
        assertTrue( counter.getNumberOfPathsToNode( b ) == 2 );
        assertTrue( counter.getNumberOfPathsToNode( c ) == 1 );
        assertTrue( counter.getNumberOfPathsToNode( d ) == 1 );
        assertTrue( counter.getNumberOfPathsToNode( e ) == 1 );
        assertTrue( counter.getNumberOfPathsToNode( f ) == 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.