A functional graph is a directed graph where every node has exactly one outgoing edge. If you are at node , there is exactly one node you can move to. This constraint creates predictable structure. Starting from any node, you follow a path that eventually enters a cycle and stays there forever.
In this section, I'll show you how to exploit this structure to answer queries about paths and cycles in logarithmic time.