Solution (source code)

= Solution

The <Thomson principle> states that the <effective resistance> is the minimum <energy of a flow> among all <unit flows> from $a$ to $b$:
$$
R_{\mathrm{eff}}(a,b)=\min_{\operatorname{div}\vartheta=\mathbf1_a-\mathbf1_b}\sum_{e\in E}r_e\vartheta(e)^2.
$$
The <flow> is antisymmetric on oriented edges, and the sum counts each unoriented edge once. The <Rayleigh monotonicity principle> states that increasing edge resistances, including deleting edges by setting their resistance to infinity, cannot decrease the <effective resistance>. Decreasing resistances or identifying vertices cannot increase it.

Take a shortest <path in a graph> from $a$ to $b$, of length $d=d_G(a,b)$, and send one unit of <flow> along it, with zero <flow> on all other edges. Its <energy of a flow> is $d$ because each edge resistance is one. The <Thomson principle> gives
$$
\boxed{R_{\mathrm{eff}}(a,b)\leq d_G(a,b).}
$$
Alternatively, delete all edges outside that path and use the <Rayleigh monotonicity principle>; the remaining edges are in series, with total resistance $d$. When $a=b$, both quantities are zero.