Chapter 3: Q17E (page 109)
Infinite paths.Let be a directed graph with a designated “start vertex” , a set of “good” vertices, and a set of “bad” vertices. An infinite trace of is an infinite sequence of vertices such that , and (2) for all , . That is, is an infinite path in starting at vertex . Since the set of vertices is finite, every infinite trace of must visit some vertices infinitely often.
- If is an infinite trace, let be the set of vertices that occur infinitely often in . Show that is a subset of a strongly connected component of .
- Describe an algorithm that determines if role="math" has an infinite trace.
- Describe an algorithm that determines if has an infinite trace that visits some good vertex in infinitely often.
- Describe an algorithm that determines if role="math" localid="1659627728759" has an infinite trace that visits some good vertex in infinitely often, but visits no bad vertex in infinitely often.
Short Answer
a. All nodes in inf (p) are visited infinite times, thus inf (p) is a subset of a strongly connected component of G .
b. An algorithm:
Input: G = (V, E)
Procedure: inf (p)
p= V [i]
for i = 0, ,
if
return
print G has an infinite trace.
c. Algorithm:
Input: G = (V, E)
Procedure: Inf (p)
print has an infinite trace that visits good vertices.
d. Algorithm:
Input: G = (V, E)
Procedure: Inf (p)
print G has an infinite trace that visits good vertices has no bad vertices.