JGraphT has many implementations for shortest paths (Dijkstra, Belman Ford and more)
I need a single source shortest path for an unweighted graph.
Here are my questions (specific to JGraphT):
First, I assume that using Dijkstra for unweighted graphs is wasteful (uses a priority queue which has slower queue deque than a regular queue that BFS uses, and since on unweighted graph all weights are 1, this is not really adding any value). Is my assumption correct?
Assuming the answer to 1 is "yes", then I assume I'll use
BreadthFirstIteratorother than rolling my own, (unit tested, and as simple BFS is, I'm sure I'll have some corner case bug, even Java's binary search had an integer overflow thank's to a bug that Josh Bloch himself introduced and it wasn't solved until 2006!). But the question is, there is still a (very small) step to take from a raw BFS to actually getting the single source shortest paths, should I write my ownUnweightedSingleSourceShortestPathsclass? or is there one hidden in JGraphT core library that I can just plug into?