{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ex3 - CSE5311 Design and Analysis of Algorithms Exercise...

This preview shows pages 1–2. Sign up to view the full content.

CSE5311 Design and Analysis of Algorithms Exercise Problems 3 1. Let G = (V,E) be an (undirected) graph with costs c e 0 on the edges e E . Assume you are given a minimum-cost spanning tree T in G . Now assume that a new edge is added to G , connecting two nodes v, w V with cost c . a. Give an efficient algorithm to test if T remains the minimum-cost spanning tree with the new edge added to G (but not to the tree T ). Make your algorithm run in time O ( E ). Can you do it in O( V ) time? b. Suppose T is no longer the minimum-cost spanning tree. Give a linear- time algorithm (time O ( E )) to update the tree T to the new minimum- cost spanning tree. 2. Let G = ( V , E ) be a connected undirected weighted graph. Assume for simplicity that the weights are positive and distinct. Let e be an edge of G . Denote by T ( e ) the spanning tree of G that has minimum cost among all spanning trees of G that contains e . Design an algorithm to find T ( e ) for all edges e E . The algorithm should run in time O ( V 2 ).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the 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