Discrete Mathematics and Its Applications, Seventh Edition

Published by McGraw-Hill Education
ISBN 10: 0073383090
ISBN 13: 978-0-07338-309-5

Chapter 11 - Section 11.4 - Spanning Trees - Exercises - Page 797: 61

Answer

Using Exercise 60 to construct an algorithm for determining whether a directed graph contains a circuit.

Work Step by Step

--According to Exercise 60, a directed graph contains a circuit if and only if there are any back edges. --We can detect back edges as follows. Add a marker on each vertex v to indicate what its status is: not yet seen (the initial situation), seen (i.e., put into T ) but not yet finished (i.e.,visit(v) has not yet terminated), or finished -(i.e., visit(v) has terminated).A few extra lines in Algorithm 1 will accomplish this bookkeeping. --then to determine whether a directed graph has a circuit, - we just have to check when looking at edge uv whether the status of v is “seen.” If that ever happens, -then we know there is a circuit; if not, then there is no circuit.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.