Question

In: Computer Science

In the shortest-path algorithm we are concerned with the total length of the path between a...

In the shortest-path algorithm we are concerned with the total length of the path between a source and every other node. Suppose instead that we are concerned with the length of the longest edge between the source and every node. That is, the bottleneck of a path is defined to be the length of the longest edge in the path. Design an efficient algorithm to solve the single source smallest bottleneck problem; i.e. find the paths from a source to every other node such that each path has the smallest possible bottleneck.

Solutions

Expert Solution

Dear Student, I have spent a lot of time in making these terms short and clean, so if you got something from it, then give it an Upvote. Thank You.

Design: The primary observation is that for any given distance d, all vertices of distance d or less from s are exactly those reachable from s along the subgraph of all edges of weight not greater than d.

Thus we seek to compute the distance to vertices in increasing order of distance and clearly, it suffices to examine the weights of the edges as every distance will correspond to one of these E values.

We maintain a heap such that at the start of each iteration the following inductive invariant is true: If the smallest edge in the heap has weight d, then every vertex of distance less than d has been found, and all the edges of weight d-or-more whose source is one of these vertices are in the heap

In an iteration of the algorithm, we extract the next minimum edge, determine all the vertices that can be reached through that edge along edges of the equal or lesser score, and update the induction.

Pseudo-code formulation:

procedure Search(v: vertex, d: weight)
{
D[v] <-- d
for v --> u in E do
if w(v --> u) <= d and D[u] = 1 then
Search(u,d)
else
   Add v --> u to Heap
}

D[v] <-- infinity for all v
D[s] <-- 0
Heap {s --> v}
while Heap !enpty do
{
e(= v --> u) <-- extract min Heap
if D[u] = 1 then
Search(u,w(e))
}

Worst-case time Complexity: An edge is added to the heap only if its source has just been assigned its distance (if then).

Therefore each edge is added to the heap at most once. Moreover, Search is only called when a vertex is about to be assigned it and so is not called more than V times. The algorithm is thus O(ElogV) in the worst case.


Related Solutions

Algorithm questions. 1.When choosing an algorithm for the shortest path between two nodes in an unweighted...
Algorithm questions. 1.When choosing an algorithm for the shortest path between two nodes in an unweighted graph, should we use Breadth First Search or Depth First Search ? 2. When choosing a data structure to store a graph for an algorithm, how should we store the graph knowing that the graph is dense and this algorithm needs to determine many times if two nodes are directly connected ? Should it be an Adjacency Matrix or an Adjacency List ?
about critical path of a project network is that, A. the critical path is the shortest...
about critical path of a project network is that, A. the critical path is the shortest of all paths through the network B. the critical path is the set of activities that has no slack time C. the critical path is that set of activities that has no positive slack time D. some networks may not have any critical path
Below is the linear programming for the Shortest Path Problem. Considering the second contraint in the...
Below is the linear programming for the Shortest Path Problem. Considering the second contraint in the mathematical model : ∑ixji−∑ixij=0∀j≠s,j≠t What is the logic behind this contraint? To make sure there is only one solution To make sure that the path is connected between the nodes To make sure the variable stays binary This contraint is redundant and not necessary Which of the following statements are true? (select all that apply) The shape of a student t-distribution curve depends on...
Below is the linear programming for the Shortest Path Problem. Considering the second contraint in the...
Below is the linear programming for the Shortest Path Problem. Considering the second contraint in the mathematical model : ∑ixji−∑ixij=0∀j≠s,j≠t What is the logic behind this contraint? To make sure there is only one solution To make sure that the path is connected between the nodes To make sure the variable stays binary This contraint is redundant and not necessary Which of the following statements are true? (select all that apply) The shape of a student t-distribution curve depends on...
i want a program in java that finds the shortest path in a 2D array with...
i want a program in java that finds the shortest path in a 2D array with obstacles from source to destination using BFS and recursion. The path must be stored in a queue. The possible moves are left,right,up and down.
Describe how the Shortest Job First (SJF)Scheduling algorithm works. Explain the differences of working procedure between...
Describe how the Shortest Job First (SJF)Scheduling algorithm works. Explain the differences of working procedure between preemptive and non-preemptive version of this algorithm.
Using the provided network diagram, write a program in c ++ that finds the shortest path...
Using the provided network diagram, write a program in c ++ that finds the shortest path routing using the Bellman-Ford algorithm. Your program should represent the fact that your node is U. Show how the iterative process generates the routing table for your node. One of the keys to your program will be in determining when the iterative process is done. Deliverables 1. Provide an output that shows the routing table for your node after each iteration. Add a second...
Question 3 Below is the linear programming for the Shortest Path Problem. Considering the second contraint...
Question 3 Below is the linear programming for the Shortest Path Problem. Considering the second contraint in the mathematical model : ∑ i x ji −∑ i x ij =0∀j≠s,j≠t What is the logic behind this contraint? 1) To make sure there is only one solution 2) To make sure that the path is connected between the nodes 3) To make sure the variable stays binary 4) This contraint is redundant and not necessary Question 4 Which of the following...
Describe and analyze an algorithm to determine the number of shortest paths from a source vertex...
Describe and analyze an algorithm to determine the number of shortest paths from a source vertex s to a target vertex t in an arbitrary directed graph G with weighted edges. You may assume that all edge weights are positive and that all necessary arithmetic operations can be performed in O(1) time. [Hint: Compute shortest path distances from s to every other vertex. Throw away all edges that cannot be part of a shortest path from s to another vertex....
Suppose we have a substring of length m and text of size n. Write an algorithm...
Suppose we have a substring of length m and text of size n. Write an algorithm to find out if the substring is present in the text or not. What is the complexity of your algorithm in terms of m and n.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT