Graphs · Exercise 47 of 100

Eulerian paths and circuits

To follow every directed edge exactly once, first check that all vertices touching an edge are connected when you ignore the arrows. If so, you can finish where you started when every vertex has as many arrows in as out. To finish somewhere else, the start needs one extra arrow out, the end needs one extra arrow in and every other vertex must balance.

Try it yourself

A courier must use each one-way street exactly once. The streets are Park to Pier, Pier to Park, Park to Mill and Mill to Dock. At which place must the courier start?

One-step hint

Make an arrivals column and a departures column for each place. The starting place needs one more departure than arrival.

Worked solution
  1. Pier and Mill each have one street in and one out. Dock has one street in and none out, so the route must end there.
  2. Park has two streets out and only one in, so it must be the start. Going from Park through Pier, Park and Mill to Dock uses every street once.
DSA compiler