Find the shortest path between two nodes using BFS.
Endpoint rule, shared by every search here (issue #65): a node the
graph does not report via hasNode is never found, not even as its
own path, so the existence check runs BEFORE the same-node
shortcut. The order matters for a host PathGraph that indexes only
nodes with edges: this search used to answer a zero-hop path for a
node the other two searches reported missing. Source equals target
on an existing node is the one zero-hop path: nodeIds: [id],
edgeIds: [], length: 0, found: true.
Find the shortest path between two nodes using BFS.
Endpoint rule, shared by every search here (issue #65): a node the graph does not report via
hasNodeis never found, not even as its own path, so the existence check runs BEFORE the same-node shortcut. The order matters for a host PathGraph that indexes only nodes with edges: this search used to answer a zero-hop path for a node the other two searches reported missing. Source equals target on an existing node is the one zero-hop path:nodeIds: [id],edgeIds: [],length: 0,found: true.