Shortest-path distance (source code)

= Shortest-path distance
{title2=$d(s,t)=\inf_{P:s\leadsto t}\sum_{e\in P}w(e)$}

The infimum of total <edge weights> over allowed walks from a source to a target. The value is $+\infty$ when no route exists. A <negative cycle> reachable from the source and able to reach the target makes it $-\infty$. In a finite graph without such a cycle, a finite distance is attained by a <graph path>, after removing non-improving repetitions.