This patch fixes T95931 by calculating the propagation distances for
each vertex individually and not breaking the propagation if a distance
has already been calculated.
This simplifies the code and makes the distances more correct.
However, as expected, this can result in an excessive slowdown in
some adverse cases.
Therefore, while a good optimization solution is not found, this
solution is still a WIP.
Ref T95931