Professional Documents
Culture Documents
Definition
A (directed) path is a sequence of edges such that, for any adjacent pair of edges ei, ej in the
sequence, the terminal node of the first edge is the initial node of the second edge.
A cycle is a directed path that begins and ends at the same node.
A chain is a sequence of nodes such that each interior node has indegree = 1 and outdegree = 1.
The initial node may have indegree = 0 or indegree > 1. The terminal node may have outde-
gree = 0 or outdegree > 1 (we will use this concept in Chapter 8).
A (directed) semipath is a sequence of edges such that for at least one adjacent pair of edges ei, ej
in the sequence, the initial node of the first edge is the initial node of the second edge or the
terminal node of the first edge is the terminal node of the second edge.
Our continuing example contains the following paths and semipaths (not all are listed):
A path from n1 to n6
A semipath between n1 and n3
A semipath between n2 and n4
A semipath between n5 and n6
4.2.5 Reachability Matrix
When we model an application with a digraph, we often ask questions that deal with paths that
let us reach (or “get to”) certain nodes. This is an extremely useful capability and is made possible
by the reachability matrix of a digraph.
Definition
The reachability matrix of a directed graph D = (V, E) with m nodes is an m × m matrix R = (r(i, j)),
where r(i, j) is a 1 if and only if there is a path from node i to node j; otherwise, the element is 0.
The reachability matrix of a directed graph D can be calculated from the adjacency matrix A as
R = I + A + A2 + A3 + … + Ak
where k is the length of the longest path in D, and I is the identity matrix. The reachability matrix
for our continuing example is as follows:
n1 n2 n3 n4 n5 n6 n7
n1 1 1 0 1 1 1 0
n2 0 1 0 0 1 0 0
n3 0 0 1 1 0 1 0
n4 0 0 0 1 0 1 0
n5 0 0 0 0 1 0 0
n6 0 0 0 0 0 1 0
n7 0 0 0 0 0 0 1
The reachability matrix tells us that nodes n2, n4, n5, and n6 can be reached from n1; node n5
can be reached from n2; and so on.
4.2.6
n-Connectedness
Connectedness of ordinary graphs extends to a rich, highly explanatory concept for digraphs.
Definition
n1 e1 n2 e4 n5
e2
n3 e3 n4 n7
e6
e5
n6
4.2.7 Strong Components
The analogy continues. We get two equivalence relations from n-connectedness: 1-connected-
ness yields what we might call “weak connection,” and this in turn yields weak components.
(These turn out to be the same as we had for ordinary graphs, which is what should happen,
because 1-connectedness effectively ignores direction.) The second equivalence relation, based on
3-connectedness, is more interesting. As before, the equivalence relation induces a partition on the
node set of a digraph; however, the condensation graph is quite different. Nodes that previously
were 0-, 1-, or 2-connected remain so. The 3-connected nodes become the strong components.
Definition
n1 e1 n2 e4 n5
e2
S1 S2