Question: Question 2. (1 marks) Suppose we have a road network between cities numbered from 1 to n. Each road connects a pair of cities, and

 Question 2. (1 marks) Suppose we have a road network between

Question 2. (1 marks) Suppose we have a road network between cities numbered from 1 to n. Each road connects a pair of cities, and can be traveled in both directions. The entire road network is represented by an undirected graph G (V, E), where V -1,... ,n) are the cities, and the edges E are the roads. Assume that the road network, i.e. the graph G, is connected. There are k roads which have been damaged, and your goal is to choose which roads to repair, so that the there is a path between each pair of cities, and the total cost of repairs is minimized. The roads E are given to you in an array R[1.. m], where each array cell Ri contains two fields: Ri].edge which contains the pair (u,v) of cities that the i-th road connects, and R[i]. cost which contains the cost of repairing the road, if it is damaged, or 0 if it is not. The cost of repairing a damaged road can be assumed to be positive. Design an algorithm to compute a set of damaged roads to be repaired, so that, after the repairs, it is possible to travel between every pair of cities by following roads that are either undamaged or repaired. Moreover, the total cost of repaired roads should be minimized. Your algorithm should have worst-case running time at most O(m logm k log k). Describe your algorithm in clear and concise English, prove it is correct, and analyze its running time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!