Say that an n-vertex directed acyclic graph G is compact if there is some way of numbering

Question:

Say that an n-vertex directed acyclic graph G is compact if there is some way of numbering the vertices of G with the integers from 0 to n−1 such that G contains the edge (i, j) if and only if i < j, for all i, j in [0,n−1]. Give an O(n2)-time algorithm for detecting if G is compact.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Data Structures and Algorithms in Java

ISBN: 978-1118771334

6th edition

Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser

Question Posted: