Handshaking lemma
In graph theory, a branch of mathematics, the handshaking lemma is the statement that every finite undirected graph has an even number of vertices with odd degree (the number of edges touching the vertex). {\displaystyle \sum _{v\in V}\deg v=2|E|} - From Wikipedia, the free encyclopedia Railroad is one of the challenges that can be solved using this lemma. Solution is if 4X +3Y ≡ 0 mod 2, then possible. Otherwise, it is impossible. And it can be reduced to just checking whether Y is even or odd.