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

  What are the challenges in rolling out a business

What is "enterprise-wide analytics technology," and how can it play a part in understand business processes? What are the challenges in rolling out a Business Intelligence tool.

  Why a website would need to be redesigned

Why do you think it is important to always be planning the next site redesign for a company.

  Using schedule performance index

Use the CPI to determine the estimate at completion (EAC) for this project. Describe whether project is performing better or worse than planned? Use the schedule performance index (SPI) to estimate how long ~ will take in order to finish this proje..

  Patients taking benefit of social networks

Patients are able to take the benefit of the social networks to do more than just the share pictures and tweets. Analyze the benefit and de-merits of utilizing the mobile computing technology in order to monitor the patients.

  What condition is it appropriate to buy commercial

Under what condition is it appropriate to develop software in house and Why? Under what circumstances is it appropriate to commission development of custom software? Why? Under what circumstance is it appropriate to buy commercial or COTS software..

  The difference between animation and transition effects

When are they appropriate? When is it better not to use them? Can you give me an examples.

  Recognizing the control procedures

Recognize one or more control procedures (either the general or application controls or both) which would guard against the following error: The Lands ford brothers had lived in the Center County all their lives. Ben worked for the local mill in ..

  Comparing relative speed of lan and wan between sites

ABC Corporation employs 40,00 people along with their own associated IP addresses, and operates over the 400 serversDescribe how the relative speed of 100BaseT LANs used at each location is compared to accessing the WAN link between two sites.

  Gaussian distribution of known covariance s

Suppose we have training data from the Gaussian distribution of known covariance S but unknown mean Mu.

  Methods to target certain audience

Recognize a particular website which you frequently go to and explain the targeted audience which visit that particular site. Provide explanation how the site is developed for its certain target audience.

  Resolving the ambiguities in the software

Describe what you must do in such a situation. You know that cost to your current employer will increase in case the ambiguities are not resolved. Though, you have also a responsibility of confidentiality to your previous employer.

  Explaining the rsa

Using the RSA with p = 3, q = 11, e = 7: Explain the suitable value for d? Encode the message “cat” by encrypting each letter separately, i.e., by encrypting ASCII code of each letter.

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