updated patch with tests (which exposes a real problem!).
I created "paired" versions (Pair<Long,Long> where its weight,output) of the two existing shortestPath tests: the simple one, and the random one. The simple one passes (somehow), but the random one triggers an assertion in shortestPaths
Basically the issue is that the original impl has an optimization: when you pick some minimum path (say 5), you know there is sequence of all zeros leading to some final state, otherwise its not actually the minimum
The code takes advantage of this and (fortunately) asserts that it finds this path of all NO_OUTPUTs.
The problem is if you have a PairOutputs(weight,output), its only NO_OUTPUT if both weight and output are also NO_OUTPUT, but this only holds true for the weight... the output has its own separately pushed minimums that don't necessarily correspond...