turicreate.shortest_path.ShortestPathModel.get_path

ShortestPathModel.get_path(vid, highlight=None)

Get the shortest path. Return one of the shortest paths between the source vertex defined in the model and the query vertex. The source vertex is specified by the original call to shortest path. Optionally, plots the path with networkx.

Parameters:
vid : string

ID of the destination vertex. The source vertex ID is specified when the shortest path result is first computed.

highlight : list

If the path is plotted, identifies the vertices (by vertex ID) that should be highlighted by plotting in a different color.

Returns:
path : list

List of pairs of (vertex_id, distance) in the path.

Examples

>>> m.get_path(vid=0)