Describe a linear time algorithm for this does di-graph g

Assignment Help Engineering Mathematics
Reference no: EM132141240

Question :

Suppose that G is a directed graph. In class we discussed an algorithm that will determine whether a given vertex can reach every other vertex in the graph (this is the 1-to-many reachability problem).

Consider the following similar problem: given graph G, is there any node in G that can reach every other node in G?

Such a node is called a "source node". We want to know whether any node of G is a source node. A trivial algorithm for this is to execute DFS n times, using each node in G as the start node of the DFS. But the total time for this algorithm is O( n* (n+m)).

Describe a linear time algorithm for this "does di-graph G have a source node problem".

Reference no: EM132141240

Questions Cloud

Design an algorithm to update the minimum spanning tre : Design an algorithm to update the minimum spanning tree when the weight of a single edge e is increased.
What speedup is possible with pipelining : What is the maximum execution rate without pipelining? What speedup is possible with pipelining?
Would there be any advantages to using the cts and rts frame : Suppose the IEEE 802.11 RTS and CTS frames were as long as the standard DATA and ACK frames.
How does the behavior of dbscan and k-means differ on : Suppose you are given two sets of 100 points that fall within the unit square. One set of points (a) is arranged so that the points are uniformly spaced.
Describe a linear time algorithm for this does di-graph g : Determine whether a given vertex can reach every other vertex in the graph (this is the 1-to-many reachability problem).
Find a shortest path from s to t : Design an algorithm that given any two vertices s and t of G, find a shortest path from s to t using O(|E|) time.
Write an algorithm to determine the two closest cities : Suppose you are given a set of cities (p number of cities) and there longitude and latitude coordinates. You need to determine the two closest cities.
Determine the expected number of die rolls until a coin flip : Explain how to use die rolls to generate unbiased coin flips, and determine the expected number of die rolls until a coin flip is generated.
Write an algorithm to transfer all elements : Write an algorithm to transfer all elements from S to T so that the top of S is the first to be inserted onto T, and the bottom of S ends up at the top of T.

Reviews

Write a Review

Engineering Mathematics Questions & Answers

  Explain how changing the price affects the output

Your write-up should introduce your solution to the project by describing the problem. Correctly identify what type of problem this is. Change the price for chocolate to $2.10 and run the model once again. Explain how changing the price affects the..

  Determine the fw of the given engineering project

Determine the FW of the following engineering project when the MARR is 15% per year. Is the project acceptable?

  Derive the mean and variance of y from the mgf

Show that the moment generating function (MGF) of Y is MY(t) = (1 - βt)-α. Derive the mean and variance of Y from the MGF. What is the distribution of Z = cY, where c is a positive number

  Sketch the corresponding bode plots

The single-degree-of-freedom robot manipulator with first-order actuator is modeled as Express the return difference function matrix for this system.

  Show the isociines of the linear differential equation

Show that the isocIines of the linear differential equation of second order are straight lines.

  What is the difference between data and information

What is the difference between Data and Information - To have an effective communication you need to meet two conditions, mention these conditions.

  Maximum number of families

Suppose further that tribe B uses twice as much water as tribe A. What is the maximum number of families of each tribe that can coexist in the valley.

  Find the probability of demand in units

Specialty Toys, Inc., sells a variety of new and innovative children's toys. Management learned that the preholiday season is the best time to introduce.

  Write down the number of the first ten employees

Write down the number of the first 10 employees that will be chosen for this survey.

  Show that ab and ba have same frobenius perron eigenvalue

Let A and B be m × r and r × m matrices, respectively. Assume both A and Bare nonnegative. Then AB and BA are square nonnegative matrices of dimension m × m.

  Evaluate the amt project using the irr method

Advanced Modular Technology (AMT) typically exhibits net annual revenues that increase over a fairly long period. In the long run, an AMT project.

  What is the hypothesis of the given theorem

Consider the following theorem "The sum of a rational number and an irrational number is an irrational number. What is the hypothesis of the theorem?

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