100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
Summary COMPREHENSIVE NOTES ON DIJKSTRA'S ALGORITHM €7,75   In winkelwagen

Samenvatting

Summary COMPREHENSIVE NOTES ON DIJKSTRA'S ALGORITHM

 10 keer bekeken  0 keer verkocht
  • Vak
  • Instelling

Includes enough information for A-level students and degree level students, comprehensive notes on Dijkstra's shortest-path algorithm | A-level content | A* Revision

Voorbeeld 1 van de 2  pagina's

  • 3 juli 2024
  • 2
  • 2023/2024
  • Samenvatting
avatar-seller
1 Theory
1.1 Relaxation
Dijkstra’s algorithm uses the technique of relaxation. For each vertex v ∈ V
in the graph G = (V, E), we maintain an attribute v.d which represents the
upper bound on the weight of a shortest path from source s to v, thus it is a
shortest-path estimate. Also for each vertex v we maintain a predecessor
v.π that is either another vertex or null.

A pseudocode implementation of the algorithm to initialise the shortest-path
estimates and predecessors is given below:
1 initialise_source(G, s)
2 for each vertex v in G.V
3 v.d = infinity
4 v.pi = null
5 s.d = 0
This initialises v.π = for all v ∈ V , s.d = 0, and v.d = inf for v ∈ V − s

Relaxing an edge (u, v) consists of testing if the shortest path to v found so
far can be improved by going through u. If so, v.d and v.π can be updated,
more specifically a decrease in the shortest-path estimate and subsequent up-
dates to v’s predecessor attribute.

A pseudocode implementation of the algorithm to perform one relaxation step
on an edge (u, v) is given as follows:

6 relax(u, v, w)
7 if v.d > u.d + w(u, v)
8 v.d = u.d + w(u, v)
9 v.pi = u

1.2 Dijkstra’s algorithm
Dijkstra’s algorithm solves the single-source shortest-paths problem on a weighted,
directed graph for the case that all edge weights are non-negative.

G = (V, E), w(u, v) ≥ 0 for each edge (u, v) ∈ E

A set S of vertices is maintained whose final shortest-path weights from the
source s have already been determined
The vertex u ∈ V − S is repeatedly selected with the shortest-path estimate,
adds u to S, and relaxes all edges leaving u

A pseudocode implementation is given below:



1

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

Verzekerd van kwaliteit door reviews

Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper riley4. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €7,75. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 83750 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€7,75
  • (0)
  Kopen