Graph Theory37 sections · 1633 units
Open in Course

Think About It

Undirected vs directed

Think about the difference:

1.1. In directed graphs, you track visiting vs visited. What about undirected?

2.2. If you visit A, then B, then see A again, is that always a cycle?

3.3. How do you avoid counting the edge You came from? Next unit explains the undirected cycle pattern.

In undirected graphs, going from A to B and back to A is not a cycle. You need to find a path back to a previously visited node that does not use the same edge you arrived on. Track the parent node to distinguish real back edges from the trivial parent edge.