Consider the algorithm we discussed in class for finding strongly connected components of a directed graph...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the algorithm we discussed in class for finding strongly connected components of a directed graph G = (V,E) by using BFS. Bob wants to decompose G into its strongly connected components. That is, he wants to find all the strongly connected components of G. He proposes the following algorithm for doing this: 1: Let k = 0 2: for each vertex u Є V do 3: 4: 5: 6: 7: 8: if u UCk (i.e., v is not contained in any of the components Co, C1,..., Ck) then Run BFS(u) on G to get a BFS tree T Run BFS(u) on GR to get a BFS tree T' Let Ck = {vvETA u E T'} be the set of vertices discovered in both runs of BFS(u) Set kk +1 end if 9: end for 10: return Co, C1,..., Ck are the strongly connected components of G Note that this can be implemented so that checking the condition of the if statement (line 3) takes constant time and so that constructing the set Ck in line 6 takes time (n) (e.g., by keeping track of appropriate boolean variables for each vertex during BFS). What is the worst-case running time (in ☺ notation) of Bob's algorithm? Explain your answer (e.g., describe what kind of input causes this running time). How does this compare to the DFS-based approach from class? Consider the algorithm we discussed in class for finding strongly connected components of a directed graph G = (V,E) by using BFS. Bob wants to decompose G into its strongly connected components. That is, he wants to find all the strongly connected components of G. He proposes the following algorithm for doing this: 1: Let k = 0 2: for each vertex u Є V do 3: 4: 5: 6: 7: 8: if u UCk (i.e., v is not contained in any of the components Co, C1,..., Ck) then Run BFS(u) on G to get a BFS tree T Run BFS(u) on GR to get a BFS tree T' Let Ck = {vvETA u E T'} be the set of vertices discovered in both runs of BFS(u) Set kk +1 end if 9: end for 10: return Co, C1,..., Ck are the strongly connected components of G Note that this can be implemented so that checking the condition of the if statement (line 3) takes constant time and so that constructing the set Ck in line 6 takes time (n) (e.g., by keeping track of appropriate boolean variables for each vertex during BFS). What is the worst-case running time (in ☺ notation) of Bob's algorithm? Explain your answer (e.g., describe what kind of input causes this running time). How does this compare to the DFS-based approach from class?
Expert Answer:
Answer rating: 100% (QA)
Bobs algorithm for finding strongly connected components using BFS has a worstcase running time of O... View the full answer
Related Book For
Fundamental Managerial Accounting Concepts
ISBN: 978-1259569197
8th edition
Authors: Thomas Edmonds, Christopher Edmonds, Bor Yi Tsay, Philip Olds
Posted Date:
Students also viewed these programming questions
-
In this exercise we will develop an algorithm to find the strong components of a directed graph G = (V, E). Recall that a vertex w V is reachable from a vertex v V if there is a directed path from...
-
Start your VM and open a terminal window (note: you may always open more than one terminal window if desired). For this laboratory exam, we will be using the network topology shown in Figure 1....
-
Why do ethical standards exist in accounting? Which professional organizations direct their standards more toward independent auditors? Which organizations direct their standards more toward...
-
Provide an example of how peoples views of nature might affect their food choices.
-
When the plaintiff was 16, he was employed by Kmart as a cashier. At the end of his training, he was required to read Kmarts policy agreement, which included an agreement to submit all employment...
-
The bills of materials for two finished products (D and E), inventory status, and other relevant information are given below. Compute the planned order releases and projected on-hand balances for...
-
How can we add Database connection script to search product item form input into MySQL Database Tables?
-
Lawrence is a 16-year-old youth who was found guilty of vandalism and assault. He was convicted of breaking into his school with two friends and writing insulting slogans on the hallway walls. He was...
-
Your gross annual pay is $19,163. Employment insurance premiums are deducted at a rate of 2.25% and Canada Pension Plan premiums are 3.75% based on total earnings. You pay income taxes at a rate of...
-
Suzy is building a snowman. It takes 4.0N of her push force and 2 seconds of time to move the bottom part of the snowman 3.0 meters. How much power was required for the task?
-
Evaluate the following expression. 13! 4!(13-4)!
-
4. For each of the following, answer briefly (no formal math needed explain intuitively). (30 points) (a) Given a training dataset with N features, is the number of nodes in any decision tree learned...
-
The Trespasser physics engine simulated rigid body box-shaped colliders and allowed the game player to easily build complicated structures such as a staircase made of crates.
-
W What was the average speed maintained by Dick Rutan and Jenna Yeager on their non-stop flight around the world?
-
What are the three elements of a business plan? Consider the situation of two sisters contemplating a new business hiring surfboards and providing surf lessons on the Sunshine Coast. Explain how the...
-
In July 2013, cnet.com listed the battery life (in hours) and luminous intensity (i. e., screen brightness, in cd/m2) for a sample of tablet computers. We want to know if screen brightness is...
-
Myrick Woodcraft Company (MWC) manufactures "antique" wooden cabinets to house modern televisions. MWC began operations in January of last year. Sidney Myrick, the owner, asks for your assistance. He...
-
Halsey Corporation manufactures products that have variable costs of $60 per unit. Its fixed cost amounts to $360,000. It sells the products for $90 each. Required Use the per-unit contribution...
-
John's Car Wash (JCW) offers customers three cleaning options. Under Option 1, only the exterior is cleaned. With Option 2, the exterior and interior are cleaned. Option 3 provides exterior waxing as...
-
Derive Eq. (13.79). Equation (13.79) Pa 1 (1+K) Mnp Mp-1 k=0 1 (Mnp+k) K k! (Mnp) (1+K,
-
Develop a MATLAB program to calculate the cumulative probability of detection.
-
The sum inside Eq. (13.79) presents a very formidable challenge. It can be, however, computed recursively with relative ease. Develop a recursive algorithm to calculate this sum. Equation (13.79)...
Study smarter with the SolutionInn App