Skip to content

Commit

Permalink
ShortestPath now interrupts traversal if nodes belongs to disconnecte…
Browse files Browse the repository at this point in the history
…d graphs

ShortestPath is bidirectional.
If one sides sees that other side is exhausted, that is, does not have any more nodes to traverse, it continues to search for hits in the current layer of nodes. Then it stops.
This improves efficiency alot when searching for shortest path between disconnected graphs where difference in graph size is large.

Moved TestShortestPath to matching package and changed visibility of MutableInteger private -> protected for usage in test.

Correct formatting, imports and other PR comments
  • Loading branch information
burqen committed May 13, 2015
1 parent d127469 commit a22eac6
Show file tree
Hide file tree
Showing 2 changed files with 256 additions and 199 deletions.

0 comments on commit a22eac6

Please sign in to comment.