RouteBuilder¶
-
class
routebuilder.RouteBuilder(graph)¶ Contructs a route that fulfills certain criteria.
-
build(*args, **kwargs)¶ Constructs a route in the given graph provided the options.
Returns: list of waypoints that constitute the route
-
-
class
routebuilder.ShortestPathRouteBuilder(graph)¶ Constructs the shortest path in the road graph.
-
build(source, target)¶ Constructs the shortest path in the given graph that runs from the source to the target node.
Returns: list of waypoints that constitute the shortest path
-
shortestPath(G, start, end)¶ Dijkstra’s algorithm for shortest paths David Eppstein, UC Irvine, 4 April 2002 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117228
Parameters: - G – the graph in dict(dict) format
- start – the starting node aka the source
- end – the finish node aka the sink
Returns: list of waypoints that constitute the shortest path
-
-
class
routebuilder.TimedRouteBuilder(graph, min_time, max_time, must_visit_nodes)¶ Constructs a route that is limited by driving time and begins and ends in the same point.