Graph Theory37 sections · 1633 units
Open in Course

Mail Delivery - Core idea

Check degrees and connectivity.

Core idea: This is a direct Euler circuit problem.

Conditions to check: 1.1. Every vertex has even degree

2.2. The graph is connected (all vertices with edges are reachable from vertex 11)

If either condition fails, output "IMPOSSIBLE".

Why must we start at vertex 11? The problem says we start and end at the post office (vertex 11). Since it's a circuit, we can start anywhere, but we need 11 in our output.

If 11 has no edges, output "IMPOSSIBLE" (can't leave the post office).