Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Generalized shortest-paths problem.In Internet routing, there are delays on lines but also, more significantly, delays at routers. This motivates a generalized shortest-paths problem.

Suppose that in addition to having edge lengths {Ie:eE} ,a graph also has vertex costs {cV:vV} . Now define the cost of a path to be the sum of its edge lengths, plusthe costs ofall vertices on the path (including the endpoints). Give an efficient algorithm for the followingproblem.

Input:A directed graph G={V,E} positive edge lengths Ie and positive vertex costs cv; a starting vertex sv.

Output:An array cost[.] such that for every vertex u,costu, is the least cost of any path from s to u (i.e., the cost of the cheapest path), under the defnition above.

Notice that cost[s]=c.

Short Answer

Expert verified

answer is not available.

Step by step solution

01

Step-1: Shortest Path Problem

The shortest path issue in graph theory is the task of finding a path between two vertex (or nodes) in a graph that minimizes the total of the weights of its constituent edges. For multiplicative weights, the generalised shortest path issue can be resolved quickly. The solution is to invert Dijkstra's algorithm.

Dijkstra algorithm is an application of single source shortest path.Dijkstra’s algorithm also known as SPF algorithm and is an algorithm for finding the shortest paths between the vertices in a graph. It returns a search tree for all the paths the given node can take. An acyclic graph is a directed graph that has no cycles. Its operation is performed in the minheap.

Dijkstra’s algorithm is a single-source shortest path problem. It is used in both directed and undirected graph with non negative weight.

Bellman Ford algorithmis an application of single source shortest path, which is used for finding the shortest distance from one vertex to other vertices of a weighted directed graph. It is almost similar to Dijkstra's algorithm but Dijkstra's algorithm is works only for the graph with positive weight and Bellman Ford algorithm is works with graphs in which edges have negative weights in its graph.

02

Step-2: Reduction Method

The algorithm takes a directed graph G=V,E with positive edge length Ie and positive vertex costs cv as input, as well as an initial vertex to compute the cost of the cheap path.

The shortest-paths problem is generalised using the reduction method.Create a graph G=V,E with the inputs . Because " G " only carries edge weights, the shortest path in G from s to t is essentially the same as in G , with some minor differences. Bellman Ford algorithm is an application of single source shortest path, which is used for finding the shortest distance from one vertex to other vertices of a weighted directed graph.

It is almost similar to Dijkstra's algorithm but Dijkstra's algorithm is works only for the graph with positive weight and Bellman Ford algorithm is works with graphs in which edges have negative weights in its graph.

Dijkstra algorithm is an application of single source shortest path.Dijkstra’s algorithm also known as SPF algorithm and is an algorithm for finding the shortest paths between the vertices in a graph. It returns a search tree for all the paths the given node can take. An acyclic graph is a directed graph that has no cycles. Its operation is performed in the minheap

Dijkstra's algorithm can be used to find the shortest path in G '.

  • This is how the reducing process works:

Take all of the vertices in G and divide them into two vertices,Vi andv0

All edges enteringv0now entervi, whereas all edges leaving v now departv0.

Assume that the edge fromv0tov0has a weight ofcv.

  • Consider one path in G , and notice how it may be transformed to an edge-weighted path of comparable weight in G' by changing the visit to vertex V0, which includes the traversal of edge V0,VI.
  • On the other hand, imagine a path in G : every extra edge visited in the operation vi,v corresponds to vertex v0.
  • To get a path in G with the same weight as the path in G' , swap these edges with the equivalent vertices.

The amount of time it will take to complete this decrease is role="math" localid="1658914597767" OV+E .

Because graph hasOV+Eand 2V vertices, Dijkstra's algorithm takes time OV2 and the overall running time isOV2.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Give an algorithm that takes as input a directed graph with positive edge lengths, and returns the length of the shortest cycle in the graph (if the graph is acyclic, it should say so). Your algorithm should take time at most O|V3|.

You are given a strongly connected directed graph G=(V,E) with positive edge weights along with a particularv0V . Give an efficient algorithm for finding shortest paths between all pairs of nodes, with the one restriction that these paths must all pass throughv0 .

Here's a proposal for how to find the length of the shortest cycle in an undirected graph with unit edge lengths. When a back edge, say (v,w), is encountered during a depth-first search, it forms a cycle with the tree edges from wtov. The length of the cyclelevel[v]-level[w+1] is where the level of a vertex is its distance in the DFS tree from the root vertex. This suggests the following algorithm:

• Do a depth-first search, keeping track of the level of each vertex.

• Each time a back edge is encountered, compute the cycle length and save it if it is smaller than the shortest one previously seen. Show that this strategy does not always work by providing a counterexample as well as a brief (one or two sentence) explanation.

Shortest paths are not always unique: sometimes there are two or more different paths with the minimum possible length. Show how to solve the following problem in O((|V|+|E|)log|V|)time.

Input:An undirected graph G=(V,E);edge lengths le>0; starting vertex sV.

Output:A Boolean array for each node u , the entry usp[u]should be true if and only if there is a unique shortest path s to u (Note:usp[s]=true)

You are given a directed graph with (possibly negative) weighted edges, in which the shortest path between any two vertices is guaranteed to have at most edges. Give an algorithm that finds the shortest path between two vertices u and v in O(KE)time.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free