# can be reduced. It might be possible to weight the search towards the beginning
# of the path, since short paths are more likely, but how far forward? It would
# need to shift depending on len(segments) - perhaps logarithmically?
# can be reduced. It might be possible to weight the search towards the beginning
# of the path, since short paths are more likely, but how far forward? It would
# need to shift depending on len(segments) - perhaps logarithmically?