Less than 1 minute
Home > @hz-9/algorithm > breadthFirstSearchShortestPath
breadthFirstSearchShortestPath() function
Using Breadth-first search algorithm to obtain shortest path information.
使用广度优先搜索算法获取最短路径信息。
Signature:
breadthFirstSearchShortestPath: <T>(graph: Graph<T>, startVertex: T | Vertice<T>) => IGraphShortestPathReturn<T>Parameters
Parameter | Type | Description |
|---|---|---|
graph | Graph<T> | The graph to traverse. |
startVertex | T | Vertice<T> | The starting vertex for the traversal. |
Returns: