0% found this document useful (0 votes)
145 views1 page

Shortest Path

The shortest path problem in graph theory involves finding the path between two vertices that minimizes the sum of edge weights, such as finding the fastest road route between locations where vertices are locations and weighted edges are road segments. There are different types of shortest path problems depending on the number of vertices involved, and important algorithms for solving these problems include Dijkstra's algorithm, Bellman-Ford algorithm, and Floyd-Warshall algorithm.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
0% found this document useful (0 votes)
145 views1 page

Shortest Path

The shortest path problem in graph theory involves finding the path between two vertices that minimizes the sum of edge weights, such as finding the fastest road route between locations where vertices are locations and weighted edges are road segments. There are different types of shortest path problems depending on the number of vertices involved, and important algorithms for solving these problems include Dijkstra's algorithm, Bellman-Ford algorithm, and Floyd-Warshall algorithm.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 1

In graph theory, the shortest path problem is the problem of finding a path between two

vertices (or nodes) such that the sum of the weights of its constituent edges is minimized.
An example is finding the quickest way to get from one location to another on a road
map; in this case, the vertices represent locations and the edges represent segments of
road and are weighted by the time needed to travel that segment.

The problem is also sometimes called the

• single-pair shortest path problem,


• The single-source shortest path problem, in which we have to find shortest paths
from a source vertex v to all other vertices in the graph.

• The single-destination shortest path problem, in which we have to find shortest


paths from all vertices in the graph to a single destination vertex v. This can be
reduced to the single-source shortest path problem by reversing the edges in the
graph.
• The all-pairs shortest path problem, in which we have to find shortest paths
between every pair of vertices v, v' in the graph.

The most important algorithms for solving this problem are:

• Floyd-Warshall algorithm solves all pairs shortest paths.


• Dijkstra's algorithm solves the single-pair, single-source, and single-destination
shortest path problems.
• Bellman-Ford algorithm solves the single source problem if edge weights may be
negative.
• A* search algorithm solves for single pair shortest path using heuristics to try to
speed up the search.
• Johnson's algorithm solves all pairs shortest paths, and may be faster than Floyd-
Warshall on sparse graphs.
• Perturbation theory finds (at worst) the locally shortest path.

Floyd–Warshall algorithm

A single execution of the algorithm will find the lengths (summed weights) of the
shortest paths between all pairs of vertices though it does not return details of the paths
themselves.

You might also like