Examples of WeightedPath


Examples of org.codehaus.plexus.graph.WeightedPath

            else
            {
                allPaths.update( this );
            }

            WeightedPath path = allPaths.getShortestPath( start, end );
        }
        catch ( GraphException ex )
        {
            return false;
        }
View Full Code Here

Examples of org.neo4j.graphalgo.WeightedPath

            return Response.serverError().entity( "params cannot be blank" ).build();
        tx = database.graph.beginTx();
        DirectionsList  directionsList =null;
        try
        {
            WeightedPath path = threeLayeredTraverserShortestPath.findShortestPath( lat1, lon1, lat2, lon2, time );
            if ( path != null )
            {
                DirectionsGenerator directionsGenerator = new DirectionsGenerator( path );
                if ( path.length() == 3 )
                    directionsList = directionsGenerator.convertOneBusPath( path, time );
                else
                    directionsList = directionsGenerator.convertTwoBusPath( path, time );
            }
            tx.success();
View Full Code Here

Examples of org.neo4j.graphalgo.WeightedPath

    }
   
    public WeightedPath findShortestPath( Double lat1, Double lon1, Double lat2, Double lon2, Double time )
    {
        long startTime = System.nanoTime();
        WeightedPath path = findPaths(lat1, lon1, lat2, lon2, time );   
        System.out.println( "time: "+ (System.nanoTime() - startTime)/ 1000000);
        System.out.println( "path: "+ path);
        return path;      
    }
View Full Code Here

Examples of org.neo4j.graphalgo.WeightedPath

    {
        if ( !paths.hasNext() )
        {
            return null;
        }
        WeightedPath path = new WeightedPathImpl( costEvaluator, paths.next() );
        if ( foundWeight != null && path.weight() > foundWeight )
        {
            return null;
        }
        foundWeight = path.weight();
        return path;
    }
View Full Code Here

Examples of org.neo4j.graphalgo.WeightedPath

        return null;
    }
   
    public Iterable<WeightedPath> findAllPaths( Node node, Node end )
    {
        WeightedPath path = findSinglePath( node, end );
        return path != null ? Arrays.asList( path ) : Collections.<WeightedPath>emptyList();
    }
View Full Code Here

Examples of org.neo4j.graphalgo.WeightedPath

    {
        // START SNIPPET: dijkstraUsage
        PathFinder<WeightedPath> finder = GraphAlgoFactory.dijkstra(
                Traversal.expanderForTypes( ExampleTypes.MY_TYPE, Direction.BOTH ), "cost" );

        WeightedPath path = finder.findSinglePath( nodeA, nodeB );

        // Get the weight for the found path
        path.weight();
        // END SNIPPET: dijkstraUsage
        return path;
    }
View Full Code Here

Examples of org.neo4j.graphalgo.WeightedPath

            }
        };
        PathFinder<WeightedPath> astar = GraphAlgoFactory.aStar(
                Traversal.expanderForAllTypes(),
                CommonEvaluators.doubleCostEvaluator( "length" ), estimateEvaluator );
        WeightedPath path = astar.findSinglePath( nodeA, nodeB );
        // END SNIPPET: astarUsage
        System.out.println( path.weight() );
    }
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.