Shortest Path Problem: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
= | = Definitions = | ||
A path is a sequence of nodes | A path is a sequence of nodes <math> x_1, x_2, x_3, \ldots, x_i </math> | ||
such that for all consecutive nodes, there exist an edge | |||
Let there be a weight assigned to each edge. | |||
= Single Source Shortest Path (SSSP) = | |||
Given a graph <math>G(V,E), w(e)</math>, source node <math>S</math>, | |||
outupt the shortest path from the source | |||
== Variants == | |||
* Single destination problem: shortest path from all nodes to a | |||
single destination | |||
* Single pair problem: Shortest path between input pair | |||
Revision as of 01:32, 28 February 2024
Definitions
A path is a sequence of nodes Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x_1, x_2, x_3, \ldots, x_i } such that for all consecutive nodes, there exist an edge
Let there be a weight assigned to each edge.
Single Source Shortest Path (SSSP)
Given a graph Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle G(V,E), w(e)} , source node Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle S} , outupt the shortest path from the source
Variants
* Single destination problem: shortest path from all nodes to a
single destination
* Single pair problem: Shortest path between input pair
