This is a change in design for the graph.NodesOf family of functions. The
alternative was to provide an equivalent set of non-panicking routines in
graph for internal use. The protection that was intended with the panic
was to panic early rather than late when an indeterminate iterator exhausts
slice index space. I think in hindsight this was an error and we should
let things blow up in that (likely rare) situation.
The majority of changes are in test code. Outside the iterator package, which
is intimately tied to the determined iterator implementations, only one test
now fails if an indeterminate iterator is used, product's Modular extended
sub-graph isomorphism example, which is an algorithm that would have time
complexity issues with large iterators anyway.
This change separates the two phases of the all pair shortest path
algorithm into different types, simplifying each part and removing a
conditional from the Dijkstra all paths code path.
With the approach to graph node mutation on edge setting the previously
existed there was an issue that the edge last used connect a pair of
nodes could result in a difference in the nodes being returned by a node
query compared to the same node associated with edges returned from an
edge query.
This change avoids dealing with that by making it implementation
dependent and stating this, and by making all the node-storing graphs
we provide mutate the nodes when edges are set.
The only call to Has for johnsonWeightAdjuster is in the preamble to
BellmanFordFor, which is always passed the known query node. If Has is
called when the graph is not in the Bellman-Ford mode or the Has query
is not the query node, the call was invalid and we should panic.