Data Structures and Algorithmic Thinking with Python: Data Structure and Algorithmic Puzzles by Narasimha Karumanchi

Data Structures and Algorithmic Thinking with Python: Data Structure and Algorithmic Puzzles by Narasimha Karumanchi

Author:Narasimha Karumanchi
Language: eng
Format: azw3, epub
Publisher: CareerMonk Publications
Published: 2017-01-06T08:00:00+00:00


Problem-28  Unique topological ordering: Design an algorithm to determine whether a directed graph has a unique topological ordering.

Solution: A directed graph has a unique topological ordering if and only if there is a directed edge between each pair of consecutive vertices in the topological order. This can also be defined as: a directed graph has a unique topological ordering if and only if it has a Hamiltonian path. If the digraph has multiple topological orderings, then a second topological order can be obtained by swapping a pair of consecutive vertices.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.