Question: Let G be a directed weighted graph, where V ( G ) = { v 1 , v 2 , , vn } . Let

Let G be a directed weighted graph, where V (G)={v1, v2,, vn}. Let B be an n \times n matrix such that entry bij denotes the distance in G from vi to vj (using a directed path). Now we are going to insert a new vertex vn+1 into G. Let wi denote the weight of the edge (vi , vn+1) and w 0 i denote the weight of the edge (vn+1, vi).(If there is no edge from vi to vn+1 or from vn+1 to vi , then wi or w 0 i is \infty , respectively.) Describe an algorithm to construct an (n+1)\times (n+1) distance matrix B0 from B and values of wi and w 0 i for 1<= i <= n.(Note that the graph G itself is not given.) Your algorithm should work in O(n 2) time. (Hint: all pairs shortest paths algorithm.)

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!