Algorithm for computing a topological ordering of a dag

Assignment Help Computer Engineering
Reference no: EM1327920

An algorithm for computing a topological ordering of a DAG (Directed Acyclic Graph) repeatedly finds a node with no incoming edges and deletes it. This will eventually produce a topological ordering, provided that the input graph really is a DAG.

But suppose that we're given an arbitrary graph that may or may not be a DAG. Extend the topological ordering algorithm so that given an input directed graph G it outputs one of two things: (a) a topological ordering, thus establishing that G is a DAG; or (b) a cycle in G, and thus establishing that G is not a DAG. The running time of your algorithm should be O(m+n) for a directed graph with n nodes and medges.

Reference no: EM1327920

Questions Cloud

Efficiencies between operating departments : Would implementing an enterprise resource planning system help streamline operations and achieve efficiencies between operating departments? What major concerns need to be addressed
Explaining organizational reactions and crisis leadership : Analyze the organizational reactions and crisis leadership in relation to the guidelines given in our text.
List some categories of risk faced by managers : List some categories of risk faced by managers. What categories of risk are most crucial for the firm's profit? Provide examples of strategies to eliminate, mitigate, or insure against these risks.
Explain ways to handle non-payment for products : Explain ways to handle non-payment for products and how does handling this situation change if you provide a service
Algorithm for computing a topological ordering of a dag : But assume that we're given an arbitrary graph that may or may not be a DAG. Extend the topological ordering algorithm so that given an input directed graph G it outputs one of two thing.
Regarding the employee safety : Should employers be responsible for employee safety while employees are working from home or working off site of the company building?
Drucker-s discussion of generic vs. exceptional issues : Using Drucker's discussion of generic vs. exceptional issues, how would you categorize/analyze the Katrina disaster.
Implement an enterprise resource planning system : Would implementing an enterprise resource planning system help streamline operations and achieve efficiencies between operating departments? What major concerns need to be addressed
Why choose database will return the k-th smallest value : as queries are expensive you would like to compute the median using as few queries as possible. Give an algorithm that fins the median value using at most O(logn) queries.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Transfering the power over ethernet

A recent article in an industry magazine discussed the ability to transfer the Power over Ethernet (PoE) and an emerging technology which is able to transfer the Power over Fiber (PoF).

  Evaluating the wireless nics

Describe whether this is still true today, and state the factors which are moving wireless NICs into the more dominant role, if any.

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  The activity undertaken after the arrival of the stimulus

Environment. The stimulus occurs within certain conditions. The system may be in an overload condition or may be running when the stimulus occurs, or some other condition might be true.

  How to protect your network to keep data safe

describe how to protect your network to keep data safe from loss or damage.

  How to exchange the floating point number

How to exchange the floating point number

  Dicsuss the business scenario that may call

express a business scenario that might call for an index-organized table.

  Handling the situation of passing of fragment through filter

If ?rst fragment is rejected, all the susequent fragments can be rejected. Though, the nature of IP is such that fragments can arrive out of order. However, an intermediate fragment may pass through ?lter before initial fragment is rejected.

  How could companies offering "free" products

The seminar uses Linux as an example of a company that understands competitive positioning. How can companies offering "free" products (e.g., Linux, Netscape) make money from these products? How can other companies compete with these fast-rising s..

  Read and follow the directions in creating an archive

How do the algorithm techniques of fragmentation affect the end result of sorting by larger amounts.

  Binary hypercube and a barrel shifter

Consider an illiacmesh (8*8) ,a binary hypercube and a barrel shifter, all with the 64 nodes labelled n0,n1…n63.all network links are bidirectional.

  Write down the definitions for the member functions

Add a boolean process "contains" to class SList that returns true if its parameter is in the list and false otherwise. Use the binary search algorithm.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd