2. Apply Algorithm 9.3.8 to find a path from d to c in the road graph...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Apply Algorithm 9.3.8 to find a path from d to c in the road graph in Example 9.1.10 using the edge list in that example. Assume that the elements of the depth sets are put into ascending order. Example 9.1.10. An Undirected Graph. A network of computers can be described easily using a graph. Figure 9.1.11 describes a network of five computers, a, b, c, d, and e. An edge between any two vertices indicates that direct two-way communication is possible between the two computers. Note that the edges of this graph are not directed. This is due to the fact that the relation that is being displayed is symmetric (i.e., if X can communicate with Y, then Y can communicate with X). Although directed edges could be used here, it would simply clutter the graph. a d Figure 9.1.11. Communications Map Figure 9.1.12. Island Road Map Algorithm 9.3.8. Breadth-first Search. A broadcasting algorithm for finding a path between vertex i and vertex j of a graph having n vertices. Each item Vk of a list V = {V1, V2, ..., Vn}, consists of a Boolean field Vk. found and an integer field V. from. The sets D1, D2,..., called depth sets, have the property that if k Dr, then the shortest path from vertex i to vertex k is of length r. In Step 5, a stack is used to put the vertex list for the path from the vertex i to vertex j in the proper order. That stack is the output of the algorithm. 1. Set the value Vk. found equal to False, k = 1, 2,...,n , 2. r = 0 3. Do = {i} 4. while (V;. found) and (Dr ) Dr+1 = 0 for each k in Dr: for each edge (k,t): If Vt. found == False: Vt. found True Vt. from = k - Dr+1 = Dr+1 U {t} r = r +1 5. if V;. found: S = EmptyStack k = j while V. from i: Pushk onto S k = Vk. from Push k onto S Push i onto S in-context 2. Apply Algorithm 9.3.8 to find a path from d to c in the road graph in Example 9.1.10 using the edge list in that example. Assume that the elements of the depth sets are put into ascending order. Example 9.1.10. An Undirected Graph. A network of computers can be described easily using a graph. Figure 9.1.11 describes a network of five computers, a, b, c, d, and e. An edge between any two vertices indicates that direct two-way communication is possible between the two computers. Note that the edges of this graph are not directed. This is due to the fact that the relation that is being displayed is symmetric (i.e., if X can communicate with Y, then Y can communicate with X). Although directed edges could be used here, it would simply clutter the graph. a d Figure 9.1.11. Communications Map Figure 9.1.12. Island Road Map Algorithm 9.3.8. Breadth-first Search. A broadcasting algorithm for finding a path between vertex i and vertex j of a graph having n vertices. Each item Vk of a list V = {V1, V2, ..., Vn}, consists of a Boolean field Vk. found and an integer field V. from. The sets D1, D2,..., called depth sets, have the property that if k Dr, then the shortest path from vertex i to vertex k is of length r. In Step 5, a stack is used to put the vertex list for the path from the vertex i to vertex j in the proper order. That stack is the output of the algorithm. 1. Set the value Vk. found equal to False, k = 1, 2,...,n , 2. r = 0 3. Do = {i} 4. while (V;. found) and (Dr ) Dr+1 = 0 for each k in Dr: for each edge (k,t): If Vt. found == False: Vt. found True Vt. from = k - Dr+1 = Dr+1 U {t} r = r +1 5. if V;. found: S = EmptyStack k = j while V. from i: Pushk onto S k = Vk. from Push k onto S Push i onto S in-context
Expert Answer:
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these computer network questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
How many bracketings of length 2n will there now be? 1 [TURN OVER CST.93.2.2 2 Two teams A and B play a match in which the winner is the first team to win n games. If A needs i games to win and B...
-
What is your debt payments-to-income ratio if your debt payments total $684 and your net income is $2,000 per month?
-
This year, Sam's employer, a privately held company, gave Sam ten shares of stock as a way of saying thank you for all his hard work. The fair market value for the ten shares totals $10,000. Sam paid...
-
Suppose a jar contains 3 pens: 1 red, 1 blue, and 1 green. Three people sign a document, one at a time. Each person selects a pen, signs the document, and then replaces the pen before the next person...
-
In Figure 8.4, are the contact force exerted by the table on the book and the gravitational force exerted by Earth on the book an interaction pair? Figure 8.4 (a) Book at rest on table (vector sum of...
-
Hall Corporation reported the following operating results for two consecutive years. Required a. Compute the percentage changes in Hall Corporations income statement components between the two years....
-
a) Explain the following terms as used in real estate appraisals i. Value in use ii. iii. Liquidation value Insurable value b) Describe the cost approach of real estate valuation c) Explain the...
-
Polly's Pizza Manufacturing prepared the a flexible budget for last month. Some of the variance analyses are reported below. "F" denotes a favorable variance and "U" denotes an unfavorable variance....
-
Can you please help me with this question! Topic 7 - Structure across time Is it possible to understand why languages change over time without having a good understanding of what drives variation at...
-
Imagine yourself to be an entrepreneur, you are presenting a business plan to investors to convince them to invest in your business? Discuss some focal points of such a discussion.
-
To what extent does the visionary leader's ability to anticipate and respond to emerging challenges and opportunities determine the organization's resilience and competitive advantage in a rapidly...
-
You have to demonstrate your knowledge of relevant terminology: labour market supply and demand, frictional and structural unemployment, long-term and short-term employment, u-rate, GDP, economic...
-
Find f. f'(x) = 20x + 1, x 0, f(1) = 13 f(x) = ||
-
Answer the following questions: 1. What is The Short Run? 2. What is a Short Run Cost? 3. Explain Variable Cost and Total Variable Cost. 4. Explain Fixed Costs, why do they remain fixed in the short...
-
KD Insurance Company specializes in term life insurance contracts. Cash collection experience shows that 20 percent of billed premiums are collected in the month before they are due, 60 percent are...
-
What is the value of equity at time zero? A. 44,055. B. 77,973. C. 122,027. Mun Hoe Yip is valuing Pure Corporation. Pure is a simple corporation that is going out of business in five years,...
-
Economic income during Year 1 is closest to: A. 23,186. B. 29,287. C. 46,101. Mun Hoe Yip is valuing Pure Corporation. Pure is a simple corporation that is going out of business in five years,...
-
What is EP during Year 1? A. 12,101. B. 6,000. C. 6,000. Mun Hoe Yip is valuing Pure Corporation. Pure is a simple corporation that is going out of business in five years, distributing its income to...
Study smarter with the SolutionInn App