Imagine you’re a superhero escaping a villain’s lair. As you move from perilous room to perilous room, the doors close immediately behind you, barring any return.
For this dramatic example, we need a directed graph, where edges restrict the direction of movement between vertices.
We can move from
lasers, but not from
spikes. This differs from earlier examples when every edge was bi-directional.
Note the path
spikes. This path is a cycle, because it ends on the vertex where it began:
Consider a city with one-way streets, how would you model this with a directed graph?
What other cycles exist in this graph?