Graph Theory37 sections · 1633 units
Open in Course

Pattern: Functional Graphs

When each node has exactly one outgoing edge.

Functional graph: Each vertex has exactly one outgoing edge.

Structure: Eventually reaches a cycle, then loops forever.

Use when:

  • State transitions where next state is deterministic
  • Following pointers (linked lists with possible cycles)
  • Repeated function application

Techniques:

  • Cycle detection (Floyd's algorithm)
  • Binary lifting for k-th successor
  • Decomposition into trees + cycles