@graphty/algorithms / index / shortestPathBFS
Function: shortestPathBFS() ​
shortestPathBFS(
graph,source,target):ShortestPathResult|null
Defined in: algorithms/traversal/bfs-unified.ts:174
Find shortest path between two nodes using BFS
Automatically optimized for large graphs. Returns null if no path exists.
Parameters ​
graph ​
The input graph to search
source ​
The source node ID
target ​
The target node ID
Returns ​
ShortestPathResult | null
Shortest path result or null if no path exists