ArticleslgStudy

computer science

Parallel single-source shortest path algorithm

Parallel single-source shortest path algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Parallel single-source shortest path algorithm rather than just read about it. In short: A central problem in algorithmic graph theory is the shortest path problem. One of the generalizations of the shortest path problem is known as the single-source-shortest-paths (SSSP) problem, which consists of finding the shortest paths from a source vertex s to all other vertices in the graph.

Parallel single-source shortest path algorithm — main illustration
Parallel single-source shortest path algorithm — illustration

Key takeaways

  • Parallel single-source shortest path algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Parallel single-source shortest path algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Parallel single-source shortest path algorithm from memory before moving on to harder problems.

Reference excerpt

A central problem in algorithmic graph theory is the shortest path problem. One of the generalizations of the shortest path problem is known as the single-source-shortest-paths (SSSP) problem, which consists of finding the shortest paths from a source vertex s to all other vertices in the graph. There are classical sequential algorithms which solve this problem, such as Dijkstra's algorithm. In this article, however, we present two parallel algorithms solving this problem. Another variation of the problem is the all-pairs-shortest-paths (APSP) problem, which also has parallel approaches: Parallel all-pairs shortest path algorithm.

Problem definition Let G=(V,E) be a directed graph with |V|=n nodes and |E|=m edges. Let s be a distinguished vertex (called "source") and c be a function assigning a non-negative real-valued weight to each edge. The goal of the single-source-shortest-paths problem is to compute, for every vertex v reachable from s, the weight of a minimum-weight path from s to v, denoted by dist⁡(s,v) and abbreviated dist⁡(v). The weight of a path is the sum of the weights of its edges. We set dist⁡(u,v):=∞ if v is unreachable from u. Sequential shortest path algorithms commonly apply iterative labeling methods based on maintaining a tentative distance for all nodes; tent⁡(v) is always ∞ or the weight of some path from s to v and hence an upper bound on dist⁡(v). Tentative distances are improved by performing edge relaxations, i.e., for an edge (v,w)∈E the algorithm sets tent⁡(w):=min⁡{tent⁡(w),tent⁡(v)+c(v,w)}. For all parallel algorithms we will assume a PRAM model with concurrent reads and concurrent writes.

Delta stepping algorithm The delta stepping algorithm is a label-correcting algorithm, which means the tentative distance of a vertex can be corrected several times via edge relaxations until the last step of the algorithm, when all tentative distances are fixed. The algorithm maintains eligible nodes with tentative distances in an array of buckets each of which represents a distance range of size Δ. During each phase, the algorithm removes all nodes of the first nonempty bucket and relaxes all outgoing edges of weight at most Δ. Edges of a higher weight are only relaxed after their respective starting nodes are surely settled. The parameter Δ is a positive real number that is also called the "step width" or "bucket width". Parallelism is obtained by concurrently removing all nodes of the first nonempty bucket and relaxing their outgoing light edges in a single phase. If a node v has been removed from the current bucket B[i] with non-final distance value then, in some subsequent phase, v will eventually be reinserted into B[i] , and the outgoing light edges of v will be re-relaxed. The remaining heavy edges emanating from all nodes that have been removed from B[i] so far are relaxed once and for all when B[i] finally remains empty. Subsequently, the algorithm searches for the next nonempty bucket and proceeds as described above. The maximum shortest path weight for the source node s is defined as L(s):=max⁡{dist⁡(s,v):dist⁡(s,v)<∞}, abbreviated L. Also, the size of a path is defined to be the number of edges on the path. We distinguish light edges from heavy edges, where light edges have weight at most Δ and heavy edges have weight bigger than Δ . Following is the delta stepping algorithm in pseudocode:

1 foreach v∈V do tent⁡(v):=∞ 2 relax(s,0); (*Insert source node with distance 0*) 3 while ¬isEmpty(B) do (*A phase: Some queued nodes left (a)*) 4 i:=min⁡{j≥0:B[j]≠∅︀} (*Smallest nonempty bucket (b)*) 5 R:=∅︀ (*No nodes deleted for bucket B[i] yet*) 6 while B[i]≠∅︀ do (*New phase (c)*) 7 Req:=findRequests(B[i],light) (*Create requests for light edges (d)*) 8 R:=R∪B[i] (*Remember deleted nodes (e)*) 9 B[i]:=∅︀ (*Current bucket empty*) 10 relaxRequests(Req) (*Do relaxations, nodes may (re)enter B[i] (f)*) 11 Req:=findRequests(R,heavy) (*Create requests for heavy edges (g)*) 12 relaxRequests(Req) (*Relaxations will not refill B[i] (h)*) 13 14 function findRequests(V′,kind:{light,heavy}):set of Request 15 return {(w,tent⁡(v)+c(v,w)):v∈V′∧(v,w)∈Ekind} 16 17 procedure relaxRequests(Req) 18 foreach (w,x)∈Req do relax(w,x) 19 20 procedure relax(w,x) (*Insert or move w in B if x<tent⁡(w)*) 21 if x<tent⁡(w) then 22 B[⌊tent⁡(w)/Δ⌋]:=B[⌊tent⁡(w)/Δ⌋]∖{w} (*If in, remove from old bucket*) 23 B[⌊x/Δ⌋]:=B[⌊x/Δ⌋]∪{w} (*Insert into new bucket*) 24 tent⁡(w):=x

Example

Following is a step by step description of the algorithm execution for a small example graph. The source vertex is the vertex A and Δ is equal to 3. At the beginning of the algorithm, all vertices except for the source vertex A have infinite tentative distances. Bucket B[0] has range [0,2], bucket B[1] has range [3,5] and bucket B[2] has range [6,8]. The bucket B[0] contains the vertex A. All other buckets are empty.

The algorithm relaxes all light edges incident to B[0], which are the edges connecting A to B, G and E. The vertices B,G and E are inserted into bucket B[1]. Since B[0] is still empty, the heavy edge connecting A to D is also relaxed.

Now the light edges incident to B[1] are relaxed. The vertex C is inserted into bucket B[2]. Since now B[1] is empty, the heavy edge connecting E to F can be relaxed.

On the next step, the bucket B[2] is examined, but doesn't lead to any modifications to the tentative distances. The algorithm terminates.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Parallel single-source shortest path algorithm

Start with the simplest possible case. Write down what Parallel single-source shortest path algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Parallel single-source shortest path algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Parallel single-source shortest path algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Parallel single-source shortest path algorithm

In research
Parallel single-source shortest path algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Parallel single-source shortest path algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Parallel single-source shortest path algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graph algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Parallel single-source shortest path algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Parallel single-source shortest path algorithm” →

How to study Parallel single-source shortest path algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Parallel single-source shortest path algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Parallel single-source shortest path algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Parallel single-source shortest path algorithm in simple terms?

A central problem in algorithmic graph theory is the shortest path problem. One of the generalizations of the shortest path problem is known as the single-source-shortest-paths (SSSP) problem, which consists of finding the shortest paths from a source vertex s to all other vertices in the graph.

Why does Parallel single-source shortest path algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Parallel single-source shortest path algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Parallel single-source shortest path algorithm.

Tags

  • Graph algorithms

Keep exploring