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...
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...
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.
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...
1) What is the shortest possible length of an mRNA molecule that corresponds to a polypeptide...
1) What is the shortest possible length of an mRNA molecule that corresponds to a polypeptide 10 amino acids long? For your answer just give me the number. E.g., "12" or "120." (Ignore the 5' cap and poly-A tail.) 2) How can the deletion of one nucleotide result in a longer polypeptide being made? Write out 2 examples of mRNA sequence (before and after the mutation) and its corresponding amino acid sequence (before and after the mutation) to show how...
I need swift programming code and instruction of app Named Shortest path. Please explain at the...
I need swift programming code and instruction of app Named Shortest path. Please explain at the end of the code how to run the app on Xcode. Thanks
You will implement two algorithms to find the shortest path in a graph. def prim(G,start_node): Takes...
You will implement two algorithms to find the shortest path in a graph. def prim(G,start_node): Takes a graph G and node to start at. Prims edges used in MST. def kruskal(G): Takes a graph G and prints the edges in the MST in order found. You may represent the graphs as adjacency matrix or list. You MAY NOT include any graph libraries. The graph you are working on will be give in a file with the following format. The graph...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT