hw6-1 - of a negative-weight cycle A negative-cycle is a...

This preview shows page 1. Sign up to view the full content.

CSE331 homework 6 (Due by the class on Nov. 8th Tuesday) All the textbook problems are in the 3 rd edition. If you don’t have the 3 rd edition, please borrow your classmates’ or mine. 1. Do textbook problem 9.5. Please list each shortest path using the edges in the path. If you choose to draw the paths in the graph, you need to use different colors to differentiate each path. (a. 10 pts, b. 5 pts) 2. Do textbook problem 9.7.a. (only part a). Please draw the graph and explicitly show the wrong path. Since you only need to provide one negative example, feel free to draw this path in the figure. (5 pts) 3. Do textbook problem 9.10.b. (only part b). (10 pts) 4. How can the output of the Floyd-Warshall algorithm be used to detect the presence
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of a negative-weight cycle? A negative-cycle is a cycle with total weight being less than zero. For example, A B C A is a cycle. If the total weight of A B, B C, and C A is negative, this is a negative-weight cycle. (5 pts) 5. Using Warshall’s algorithm to find all-pairs shortest path in the following graph (on page 2). a) Show the matrix D and P for each k. (see the pseudo-code in the lecture notes). For k from 0 to 5, you only need to show matrix cells with changes. (10 pts) b) Show the final all-pairs shortest paths. Describe each path using edges in them. For example, you could describe a path from V1 to V2 as V1 V3 V2 (5 pts) 3 V 5 V 4 -1 6 8 -3 10 -2 V 3 V 2 V 1 -4...
View Full Document

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern