subject

Chapter 6 problem 3: Let G = (V, E) be a directed graph with nodes v1,..., Vn. We say that G is an ordered graph if it has the following properties.
(1) Each edge goes from a node with a lower index to a node with a higher index. That is, every
directed edge has the form (vi, vy) with i (ii) Each node except v, has at least one edge leaving it. That is, for every node
Vi, i = 1,2,..., 1 - 1, there is at least one edge of the form (Vi, v;). The length of a path is the
number of edges in it. The goal in this question is to solve the following problem (see Figure 6.29 for
an example)
Given an ordered graph G, find the length of the longest path that begins at vi and ends at un
(a) Show that the following algorithm does not correctly solve this problem, by giving an example
of an ordered graph on which it does not return the correct answer.

Figure 6.29 The correct answer for this ordered graph is 3: The longest path from v to
v, uses the three edges (U). Vs), (, Vs), and (V, Vs).
Set w=0
Set L = 0
While there is an edge out of the node w
Choose the edge (w, vy)
for which j is as small as possible
Set w = 0;
Increase L by 1
end while
Return L as the length of the longest path
In your example, say what the correct answer is and also what the algorithm above finds.
(b) Give an efficient algorithm that takes an ordered graph G and retums the length of the longest
path that begins at Uy and ends at vn (Again, the length of a path is the number of edges in the
path.)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Based on the current economic situation do you expect the employment demand for graduating engineers to increase or decrease? explain the basis for your answer. with a significant economic recovery, what do you think will happen to future enrollments in graduating engineering programs?
Answers: 1
You know the right answer?
Chapter 6 problem 3: Let G = (V, E) be a directed graph with nodes v1,..., Vn. We say that G is an...
Questions
question
Mathematics, 14.04.2021 18:20
question
Mathematics, 14.04.2021 18:20
Questions on the website: 13722363