Less than 1 minute
Home > @hz-9/algorithm > breadthFirstSearchShortestPathString
breadthFirstSearchShortestPathString() function
Using Breadth-first search algorithm to obtain shortest path information.(Return string)
使用广度优先搜索算法获取最短路径信息。(返回字符串)
Signature:
breadthFirstSearchShortestPathString: <T>(graph: Graph<T>, startVertex: T | Vertice<T>, chars?: string) => stringParameters
Parameter | Type | Description |
|---|---|---|
graph | Graph<T> | The graph to traverse. |
startVertex | T | Vertice<T> | The starting vertex for the traversal. |
chars | string | (Optional) The separator between vertices. Default is |
Returns:
string