- a recursive case, where a predicate is derived by itself, and
- a base case, which must not be derivable by itself, allowing the recursion to terminate.
- A simple edge between 2 nodes.
- The list of such edges between any 2 nodes, via N-2 other nodes.
path can be a simple hop from one node to another, or requires 2 hops (via 1 intermediate node), or via 3 hops (via 2 intermediate nodes).
Transitive Closure
The task of finding out all pairs of nodes in a graph that are connected to each other either directly or indirectly is known as transitive closure. You might think of this asking if it’s possible to fly from some airport to another in one or more direct flights. Consider the following small graph:
path contains the following tuples:
a, you can arrive at any other node. However, from b, you may only visit c, d, e and h.
