Solution (source code)

= Solution

A \b[<shortest path>] from $u$ to $v$ is a <graph path> $P$ joining these endpoints such that
$$
w(P)\leq w(P')
$$
for every other $uv$-path $P'$ in $G$, where $w(P)$ is the sum of its edge weights. Here paths have no repeated vertices; minimizing over unrestricted walks is a different problem when negative edge weights occur.