Skip to content
Back to exploration
Mathematical modeling / English

Dijkstra's Algorithm (finding shortest path)

Bryn Humberstone · YouTube · 4:21

Open original
READ & KEEP

The explanation, unpacked.

Reviewed learning material · Video analysis · English
Read the full overview

This video demonstrates the first few steps of Dijkstra's algorithm on a weighted network to find the shortest path from 'home' to 'university'. It covers initializing the start vertex, iteratively updating neighbor distances, selecting the minimum uncircled vertex, and resolving multiple distance values at a single vertex by keeping only the minimum. This 120-second clip shows the later stages of a Dijkstra shortest-path worked example on a weighted graph from "home" to "university". Starting with several vertices already settled, the presenter explains why the target label 7 cannot be accepted immediately: the smallest uncircled vertex must still be processed. Vertex E with label 4 is settled first, producing a candidate 9 at university that is crossed out. Vertex B with label 6 is settled next, producing a candidate 8 that is also crossed out. Only then is 7 at university circled as the final shortest distance. The clip ends by following predecessor arrows backward to reconstruct the shortest path as home → A→DA \to D → university. This video segment demonstrates the final phase of solving a shortest path problem on a weighted graph, likely using Dijkstra's algorithm. It shows how to backtrack from the destination node ('university') to the source node ('home') to identify the exact sequence of vertices in the optimal path. The presenter highlights the path edges in yellow and writes out the sequence: home - A - D - university. Finally, the total minimum distance is calculated by summing the weights of these edges, resulting in a value of 7.

Use the learning inspector for key ideas and moments, or open the reading tabs for the complete notes.

Chapters

0:00Introduction to Dijkstra's Algorithm0:10Problem Setup: Home to University0:15Step 1: Initialization0:27Step 2: Updating Neighbors0:41Step 3: Selecting Minimum Vertex0:54Step 4: Further Updates and Cross-outs1:19Step 5: Continuing the Algorithm2:00Graph state and updates from A2:13Why 7 is not final yet2:27Process E and reject candidate 92:54Process B and reject candidate 83:30Finalize distance 73:43Backtrack to recover the path4:00Backtracking the Shortest Path4:14Calculating Minimum Distance

Learning script

Generated from the video's visuals and explanation; not verbatim speech.

The video introduces Dijkstra's algorithm as a systematic method for finding the shortest path between two vertices in a network.

A specific problem is presented: finding the shortest path from the 'home' vertex to the 'university' vertex on a weighted graph.

The algorithm begins by initializing the starting vertex 'home' with a distance of 0 and marking it as visited by drawing a circle around it.

Next, the algorithm examines the neighbors of the current circled vertex ('home') that have not yet been visited.

The distances to these neighbors are calculated by adding the edge weight to the current vertex's distance: vertex A gets a distance of 2, and vertex C gets a distance of 3.

The algorithm then identifies the smallest distance among all uncircled vertices, which is 2 at vertex A.

Vertex A is circled to mark it as visited, and an arrow is drawn from 'home' to A to record the path taken.

The process repeats for the newly circled vertex A, updating its unvisited neighbors.

The distance to B is calculated as 2+4=62 + 4 = 6.

The distance to D is calculated as 2+2=42 + 2 = 4.

An alternative distance to C is calculated as 2+2=42 + 2 = 4.

Since vertex C now has two distance values (3 and 4), the algorithm applies a rule to keep only the minimum.

The larger value, 4, is crossed out, leaving 3 as the valid distance for C.

The algorithm scans the remaining uncircled vertices (C=3C=3, D=4D=4, B=6B=6) and selects the smallest distance, which is 3 at vertex C.

Vertex C is circled, and an arrow is drawn from 'home' to C.

Updating neighbors of C, the path to A is ignored because A is already visited.

The distance to E is calculated as 3+1=43 + 1 = 4.

With uncircled vertices B=6B=6, D=4D=4, and E=4E=4, the algorithm encounters a tie for the minimum distance.

The presenter chooses vertex D arbitrarily to proceed.

Vertex D is circled, and an arrow is drawn from A to D, continuing the path reconstruction.

The clip opens on a weighted graph with vertices labeled home, A, B, C, D, E, and university. Several distances are already settled: home has 0, A has 2, C has 3, and D has 4. The narrator continues from an already selected vertex and computes new candidates: from A to B gives 2+4=62+4=6, and the visible candidate at university is 7. The spoken arithmetic "four plus three is seven" matches the route through D, since D already has label 4 and the edge D–university has weight 3.

The key method point is stated explicitly: the presenter does not circle 7 at university yet because there are still other uncircled vertices to consider. The next vertex chosen is the smallest uncircled label, which is 4 at E. This demonstrates the core rule of the algorithm: settle the smallest tentative distance first, even if the destination already has a candidate value.

To justify that rule, the video highlights the region involving E and university and gives a hypothetical comparison. If the edge from E to university had weight 1 or 2, then the path through E would produce a shorter total than 7. That counterfactual explains why a target label cannot be accepted while a smaller unsettled vertex remains.

The actual edge weight from E to university is 5, so the update from E gives 4+5=94+5=9. The number 9 is written at university and then crossed out because 9>79>7. This is a concrete example of label comparison: a newly discovered route is kept only if it improves the current best distance.

After E is handled, the smallest remaining uncircled label is 6 at B, so B is selected next. The presenter draws the predecessor arrow from A to B, reinforcing that each settled label should remember which earlier vertex produced it. The distance from home to B is therefore 6.

From B, the only relevant new update is to university: 6+2=86+2=8. The candidate 8 is written at university and then crossed out because 8>78>7. At this stage, every smaller uncircled candidate has been processed, so the old label 7 at university is now the smallest remaining uncircled value.

The presenter circles 7 at university and states the conclusion of the computation: the shortest distance from home to university is 7. This is the final numerical answer of the worked example.

The last step recovers the actual route, not just the distance. By following predecessor arrows backward from university, the path is traced as university ← D ← A ← home. Reversing that chain gives the shortest path home → A→DA \to D → university. The yellow highlighting makes the backward reconstruction visually explicit.

To find the actual shortest path after computing the distances, it is smart to work backwards from the destination. Starting at 'university', we trace back along the highlighted edges to see that it came from 'D', which came from 'A', which originated from 'home'.

Depending on the specific requirements of the problem, you must also report the total cost. By summing the weights of the edges along this path (2+2+32 + 2 + 3), we determine that the minimum distance is 7.

Knowledge cards

01

Dijkstra's Algorithm Definition

A systematic method used to find the shortest path between two vertices in a weighted network. It works by iteratively selecting the unvisited vertex with the smallest known distance, updating its neighbors, and marking it as visited.

02

Initialization Step

Begin the algorithm by assigning a distance of 0 to the starting vertex and marking it as visited (e.g., by circling it). All other vertices are typically considered to have an infinite initial distance until updated.

d(start)=0d(start) = 0
03

Updating Neighbor Distances

For the current visited vertex, calculate the tentative distance to each unvisited neighbor by adding the edge weight to the current vertex's distance. If this new distance is smaller than any previously recorded distance for that neighbor, update it.

d(neighbor)=min(d(neighbor),d(current)+w(current,neighbor))d(neighbor) = min(d(neighbor), d(current) + w(current, neighbor))
04

Selecting the Next Vertex

After updating neighbors, identify the unvisited vertex with the smallest recorded distance. Mark this vertex as visited and draw an arrow from its predecessor to reconstruct the shortest path later.

05

Handling Multiple Distances

If a vertex receives multiple distance calculations from different paths, only the smallest value represents the true shortest distance found so far. Larger values must be discarded (crossed out) to avoid errors in subsequent steps.

06

Do not finalize the destination too early

This card captures the main procedural lesson of the clip. Even though university already shows candidate distance 7, the presenter refuses to circle it immediately because another uncircled vertex, E with label 4, is still smaller. The algorithm must settle the smallest uncircled vertex first before the destination label can be trusted as final.

07

Meaning of vertex labels and circles

In the worked example, each number at a vertex is the current best known distance from home to that vertex. A blue circle marks that the distance has been accepted as final for that vertex during this run of the algorithm. Uncircled numbers remain tentative candidates that can still be improved or compared.

08

Predecessor arrows store the route

When a vertex is selected or updated, the presenter draws an arrow from the vertex that supplied the current best label. For example, C→EC\to E records how E got label 4, and A→BA\to B records how B got label 6. These arrows are not decorative; they are the data used later to reconstruct the shortest path.

09

Updating university from E gives 9 and rejects it

From E, whose settled distance is 4, the edge to university has weight 5, so the new candidate is 4+5=94+5=9. Since university already has candidate 7, the value 9 is crossed out. This shows the comparison rule: keep the smaller label and discard the larger one.

4+5=94+5=9
10

Updating university from B gives 8 and rejects it

After B is settled with distance 6, the edge from B to university has weight 2, producing candidate 6+2=86+2=8. Again this is worse than the existing 7, so 8 is crossed out. Only after these checks does 7 become safe to finalize.

6+2=86+2=8
11

Final shortest distance in the example

Once E and B have been processed and no smaller uncircled candidate remains, the label 7 at university is circled. The clip states the result directly: the shortest distance from home to university is 7.

12

Reconstruct the shortest path by backtracking

The final distance is not the whole answer. To find the route, start at university and follow predecessor arrows backward: university came from D, D came from A, and A came from home. Reversing that chain yields the shortest path home → A→DA \to D → university.

13

Path Reconstruction via Backtracking

After an algorithm like Dijkstra's computes the shortest distance to every node, the specific path to the target can be found by starting at the target and repeatedly moving to the predecessor node that yielded the minimum distance, until the source is reached.

14

Calculating Total Path Weight

The total distance or cost of a path in a weighted graph is the sum of the weights of all edges contained in that path. In this example, the path home -> A -> D -> university has a total weight of 2+2+3=72 + 2 + 3 = 7.

Detailed learning notes

Explore conditions, steps and evidence. Supplementary explanations are labeled separately from content shown in the video.

Symbols · 27

home

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The leftmost vertex of the weighted graph is labeled 'home'.

Symbol

home

Meaning

The starting vertex for the shortest path problem.

Domain

Vertex in a weighted graph

university

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The rightmost vertex of the weighted graph is labeled 'university'.

Symbol

university

Meaning

The target vertex for the shortest path problem.

Domain

Vertex in a weighted graph

A

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A vertex in the graph is labeled 'A'.

Symbol

A

Meaning

An intermediate vertex in the network.

Domain

Vertex in a weighted graph

B

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A vertex in the graph is labeled 'B'.

Symbol

B

Meaning

An intermediate vertex in the network.

Domain

Vertex in a weighted graph

C

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A vertex in the graph is labeled 'C'.

Symbol

C

Meaning

An intermediate vertex in the network.

Domain

Vertex in a weighted graph

D

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A vertex in the graph is labeled 'D'.

Symbol

D

Meaning

An intermediate vertex in the network.

Domain

Vertex in a weighted graph

E

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A vertex in the graph is labeled 'E'.

Symbol

E

Meaning

An intermediate vertex in the network.

Domain

Vertex in a weighted graph

home

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The leftmost vertex is labeled "home" and carries the circled value 0.

Symbol

home

Meaning

source vertex of the shortest-path computation

Domain

vertex of the displayed weighted graph

university

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The rightmost vertex is labeled "university" and later receives candidate labels 7, 9, and 8 before the final circled 7.

Symbol

university

Meaning

target vertex whose shortest distance from home is being found

Domain

vertex of the displayed weighted graph

A

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Vertex A is already circled with label 2 at the start of the clip.

  2. Audio
    Observation

    The speaker uses A as the current vertex when computing paths to B and D.

Symbol

A

Meaning

intermediate vertex with settled shortest distance 2 from home

Domain

vertex of the displayed weighted graph

B

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Vertex B first shows candidate label 6, then is circled with 6.

  2. Audio
    Observation

    "we can go up to B here, four plus two is six."

Symbol

B

Meaning

intermediate vertex whose settled shortest distance becomes 6

Domain

vertex of the displayed weighted graph

C

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Vertex C is already circled with label 3 at the start of the clip.

Symbol

C

Meaning

intermediate vertex with settled shortest distance 3 from home

Domain

vertex of the displayed weighted graph

Knowledge points · 12

Dijkstra's Algorithm

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    In this video we're going to be looking at Dijkstra's algorithm, which is a systematic way to determine the shortest path from one vertex to another vertex within a network.

Definition
Explanation

A systematic method used to find the shortest path between two vertices in a weighted network.

Conditions
  1. The network must have non-negative edge weights.

Initialization Step

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    To start off with, what we're going to do is next to the vertex home, we're going to put a zero because it is zero distance from home, and we're going to circle that vertex.

  2. Animation
    Observation

    A blue '0' is written next to the 'home' vertex, and a blue circle is drawn around it.

Method
Explanation

Assign a distance of 0 to the starting vertex and mark it as visited (circled).

Conditions
  1. Applies to the starting vertex of the path.

Prerequisites
  1. Dijkstra's Algorithm

Updating Neighbors

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Now at each stage we're going to look at the circled vertex and work out its neighbors that aren't circled yet. So we can go to A, which is two away, and we can go to C, which is three away.

  2. Animation
    Observation

    Blue numbers '2' and '3' are written next to vertices A and C respectively.

Method
Explanation

For the current circled vertex, calculate the total distance to its unvisited neighbors by adding the edge weight to the current vertex's distance. Write these new distances next to the neighbors.

Conditions
  1. Only applies to neighbors that are not yet circled.

Prerequisites
  1. Initialization Step

Selecting the Next Vertex

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Now we look for the smallest uncircled number that we've written on our graph. In this case it's two, so we're going to circle that and we're going to draw an arrow indicating where that has come from. It's come from home.

  2. Animation
    Observation

    The number '2' at vertex A is circled, and a blue arrow is drawn from 'home' to A.

Method
Explanation

Identify the smallest distance among all uncircled vertices. Circle this vertex and draw an arrow from its predecessor to record the shortest path.

Conditions
  1. Applies when there are uncircled vertices with assigned distances.

Prerequisites
  1. Updating Neighbors

Handling Multiple Distances

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Whenever we have two or more numbers at a vertex, we're going to cross out any number that isn't equal to the minimum. So in this case we've got three and four at C, so we're going to just cross out that four.

  2. Animation
    Observation

    The number '4' at vertex C is crossed out with a blue line.

Method
Explanation

If a vertex receives multiple distance calculations, keep only the smallest value and cross out the larger ones.

Conditions
  1. Occurs when a vertex is reachable via multiple paths from different circled vertices.

Prerequisites
  1. Updating Neighbors

Select the smallest uncircled vertex before finishing

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "Now, we don't just conclude that seven must be the shortest distance because we've still got some other vertices to consider. So the smallest uncircled vertex is this other four down here"

  2. Diagram
    Observation

    The label 4 at E is circled before the label 7 at university is finalized.

Method
Explanation

The clip demonstrates that a candidate label at the target is not final until it is the smallest uncircled label remaining. The next chosen vertex is the smallest uncircled one, here E with label 4.

Formula
Conditions
  1. The graph is being processed by the displayed shortest-path method.

  2. Vertices with circled labels are treated as already selected.

  3. Uncircled labels are still candidates.

Prerequisites
  1. Meaning of the numeric vertex labels in this worked example

Meaning of the numeric vertex labels in this worked example

Clear evidence
Derived from the video
Evidence
  1. Diagram
    Observation

    Numeric labels accumulate at vertices and are compared across the graph.

  2. Audio
    Observation

    The speaker interprets labels as distances, e.g. "the distance from home to B is six".

Uncertainties
  1. The video never states a formal definition with symbols; this item records the operational meaning visible in the worked example.

Definition
Explanation

In this demonstration, a number written at a vertex represents the current best known distance from home to that vertex. A circled number indicates that this distance has been accepted as final for that vertex in the run of the algorithm.

Formula
Conditions
  1. Applies to the specific whiteboard-style demonstration shown in the clip.

Predecessor arrows record the route that produced a label

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "circle that now and indicate where that has come from"

  2. Diagram
    Observation

    Arrows are drawn from A to B, from C to E, and from D to university.

  3. Audio
    Observation

    "Working backwards from university, we've come from D ... that's come from A ... that's come from home."

Method
Explanation

Whenever a vertex is selected or updated, the presenter draws an arrow from the vertex that supplied the current best label. These arrows are then followed backward to reconstruct the shortest path.

Formula
Conditions
  1. Used when a new best label is assigned or when a selected vertex needs its predecessor recorded.

Prerequisites
  1. Meaning of the numeric vertex labels in this worked example

Shortest distance from home to university

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "And now finally we've got this seven here is the smallest uncircled vertex"

  2. Audio
    Observation

    "that tells us that the shortest distance from home to university is seven."

  3. Diagram
    Observation

    The label 7 at university is circled as the last selected value.

Method
Explanation

After all smaller uncircled candidates have been processed, the label 7 at university becomes the smallest uncircled vertex and is circled. The presenter concludes that the shortest distance from home to university is 7.

Formula
Conditions
  1. All relevant vertices with smaller tentative labels have already been processed.

Prerequisites
  1. Select the smallest uncircled vertex before finishing
  2. Meaning of the numeric vertex labels in this worked example

Reconstruct the shortest path by following predecessor arrows backward

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "We can also conclude the path to take. Working backwards from university, we've come from D ... following the arrow backwards from D, that's come from A ... and then following from A, that's come from home."

  2. Animation
    Observation

    Yellow highlighting traces university ← D ← A ← home in reverse order.

Uncertainties
  1. The spoken sentence after "When you're writing this out, it's" is cut off before completion.

Method
Explanation

Once the destination label is finalized, the actual route is recovered by starting at university and repeatedly moving to the predecessor indicated by the drawn arrow. In this example the backward chain is university ← D ← A ← home, giving the forward path home → A→DA \to D → university.

Formula
Conditions
  1. Predecessor arrows must have been recorded during the label updates.

Prerequisites
  1. Predecessor arrows record the route that produced a label
  2. Shortest distance from home to university

Path Backtracking in Shortest Path Algorithms

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Speaker explains working from right to left to find the path: 'university has come from D, has come from A, has come from home'.

  2. Diagram
    Observation

    Yellow highlighted edges show the path from home to university. The speaker writes the sequence 'home - A - D - university' below the graph.

Method
Explanation

After computing the shortest distances to all nodes (typically using an algorithm like Dijkstra's), the actual shortest path can be found by backtracking from the destination node to the source node. At each step, one identifies the predecessor node that yielded the minimum distance.

Formula
Conditions
  1. The shortest distances and predecessors for all nodes must have been previously computed.

Reporting Minimum Distance

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Speaker states: 'you should also indicate what the distance was and the minimum distance was seven'.

  2. Diagram
    Observation

    The number 7 is written next to the final path sequence.

Method
Explanation

In many shortest path problems, simply identifying the sequence of nodes is not enough; the total cost or distance of that path must also be calculated and reported. This is the sum of the weights of the edges along the shortest path.

Formula
Conditions
  1. The shortest path has been identified.

Prerequisites
  1. Path Backtracking in Shortest Path Algorithms
Claims and conditions · 4

A target label is not final merely because it appears first

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "Now, we don't just conclude that seven must be the shortest distance because we've still got some other vertices to consider."

Proposition
Statement

In this worked run of Dijkstra's algorithm, seeing a candidate distance 7 at university does not allow immediate termination while a smaller uncircled candidate remains.

Hypotheses
  1. The graph contains multiple uncircled vertices.

  2. At least one uncircled vertex has a label smaller than the target's current label.

Quantifiers

For the displayed graph state, if an uncircled vertex has a smaller label than the target, then the target label is not yet final.

Why E must be checked before accepting 7

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "if the edge from E to university had just been one or two, then that would actually give us a shorter path."

Uncertainties
  1. This is presented as a hypothetical comparison, not as an alteration actually made to the displayed graph.

Proposition
Statement

If the edge weight from E to university were 1 or 2, then the path through E would produce a shorter route to university than the currently visible label 7.

Hypotheses
  1. The settled distance to E is 4.

  2. The edge under consideration connects E to university.

Quantifiers

For edge weights w(E, university) ∈ {1, 2}, the resulting candidate distance 4+w4 + w is less than 7.

Final shortest distance in the example

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "that tells us that the shortest distance from home to university is seven."

  2. Diagram
    Observation

    The final circled label at university is 7.

Proposition
Statement

For the weighted graph shown in the clip, the shortest distance from home to university is 7.

Hypotheses
  1. The displayed edge weights are fixed.

  2. The algorithm is applied as demonstrated on this graph.

Quantifiers

For the specific graph instance shown, the minimum path length from home to university equals 7.

Final shortest path in the example

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "Working backwards from university, we've come from D ... that's come from A ... that's come from home."

  2. Animation
    Observation

    Yellow highlight marks the edges home-A, A-D, and D-university.

Proposition
Statement

The shortest route identified by the worked example is home → A→DA \to D → university.

Hypotheses
  1. The predecessor arrows recorded during the algorithm are correct for the displayed run.

Quantifiers

For the specific graph instance shown, the reconstructed minimizing path is home → A→DA \to D → university.

Derivations and proofs · 8

First Iteration Neighbor Update

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    So we can go to A, which is two away, and we can go to C, which is three away.

  2. Animation
    Observation

    Numbers 2 and 3 appear next to A and C.

Visual argument
Steps
  1. Expression
    d(A)=d(home)+w(home,A)=0+2=2d(A) = d(home) + w(home, A) = 0 + 2 = 2
    Explanation

    Calculate distance to A from home.

    Justification

    Edge weight from home to A is 2.

    Shown in the video
  2. Expression
    d(C)=d(home)+w(home,C)=0+3=3d(C) = d(home) + w(home, C) = 0 + 3 = 3
    Explanation

    Calculate distance to C from home.

    Justification

    Edge weight from home to C is 3.

    Shown in the video
Conclusion

Distances to A and C are updated to 2 and 3 respectively.

Second Iteration Neighbor Update

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    So we've got B is a neighbor, two plus four is six. D is a neighbor, two plus two is four. And C is a neighbor, two plus two is four.

  2. Animation
    Observation

    Numbers 6, 4, and 4 appear next to B, D, and C.

Visual argument
Steps
  1. Expression
    d(B)=d(A)+w(A,B)=2+4=6d(B) = d(A) + w(A, B) = 2 + 4 = 6
    Explanation

    Calculate distance to B from A.

    Justification

    Edge weight from A to B is 4.

    Shown in the video
  2. Expression
    d(D)=d(A)+w(A,D)=2+2=4d(D) = d(A) + w(A, D) = 2 + 2 = 4
    Explanation

    Calculate distance to D from A.

    Justification

    Edge weight from A to D is 2.

    Shown in the video
  3. Expression
    d(C)=d(A)+w(A,C)=2+2=4d(C) = d(A) + w(A, C) = 2 + 2 = 4
    Explanation

    Calculate alternative distance to C from A.

    Justification

    Edge weight from A to C is 2.

    Shown in the video
Conclusion

Distances to B, D, and an alternative to C are calculated.

Third Iteration Neighbor Update

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    From this just circled vertex, we could get to A but we've already worked out the shortest distance there is two. So we can get to E though, three plus one is four.

  2. Animation
    Observation

    Number 4 appears next to E.

Visual argument
Steps
  1. Expression
    d(E)=d(C)+w(C,E)=3+1=4d(E) = d(C) + w(C, E) = 3 + 1 = 4
    Explanation

    Calculate distance to E from C.

    Justification

    Edge weight from C to E is 1.

    Shown in the video
Conclusion

Distance to E is updated to 4.

Update neighbors from the already selected vertex A

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "All right, from that one, we can go up to B here, four plus two is six. We can go to the university, four plus three is seven, and we can't go anywhere else."

  2. Diagram
    Observation

    Candidate labels 6 at B and 7 at university appear after processing from A.

Uncertainties
  1. The opening words are fragmentary, but the arithmetic and resulting labels are clear.

Visual argument
Steps
  1. Expression
    d(A)=2d(A)=2
    Explanation

    Vertex A is already circled with label 2 at the start of the clip.

    Justification

    Observed diagram state.

    Shown in the video
  2. Expression
    d(B)=d(A)+w(A,B)=2+4=6d(B)=d(A)+w(A,B)=2+4=6
    Explanation

    From A, the presenter computes a candidate label 6 for B.

    Justification

    Audio arithmetic plus visible edge weight 4 on A-B.

    Shown in the video
  3. Expression
    d(university)=d(A)+w(A,university)=2+3=5d(\text{university})=d(A)+w(A,\text{university})=2+3=5
    Explanation

    Using the visible edge weight 3 from A to university, the arithmetic gives 5, but the clip instead shows and says 7 from the path through D.

    Justification

    Diagram shows edge A-university with weight 3, while audio says "four plus three is seven" and the written candidate at university is 7.

    Shown in the video
  4. Expression
    d(university)=d(D)+w(D,university)=4+3=7d(\text{university})=d(D)+w(D,\text{university})=4+3=7
    Explanation

    The displayed candidate 7 at university matches the path through D, whose settled label is 4 and whose edge to university has weight 3.

    Justification

    Visible labels and edge weights on D-university.

    Derived from the video
Conclusion

Processing from A yields a candidate 6 at B, and the visible candidate 7 at university corresponds to the route through D rather than directly from A.

Why E is processed before accepting university = 7

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "the smallest uncircled vertex is this other four down here"

  2. Audio
    Observation

    "looking at the E, we've got four there, and that is nine to the university"

  3. Diagram
    Observation

    E is circled with 4, then 9 is written at university and crossed out against 7.

Visual argument
Steps
  1. Expression
    min⁡{uncircled labels}=4 at E\min\{\text{uncircled labels}\}=4 \text{ at } E
    Explanation

    Among uncircled vertices, E has the smallest label.

    Justification

    Audio explicitly identifies "this other four down here" as the smallest uncircled vertex.

    Shown in the video
  2. Expression
    d(E)=3+w(C,E)=3+1=4d(E)=3+w(C,E)=3+1=4
    Explanation

    The label 4 at E comes from C with an edge of weight 1.

    Justification

    Visible circled label 3 at C, edge weight 1 on C-E, and arrow C→EC\to E.

    Derived from the video
  3. Expression
    d(university)=d(E)+w(E,university)=4+5=9d(\text{university})=d(E)+w(E,\text{university})=4+5=9
    Explanation

    From E, the presenter computes a candidate 9 for university.

    Justification

    Audio says "that is nine to the university" and the diagram shows 9 written at university.

    Shown in the video
  4. Expression
    9>79>7
    Explanation

    The new candidate 9 is worse than the existing candidate 7, so 9 is crossed out.

    Justification

    Audio: "we're going to cross out nine because that's not the smallest."

    Shown in the video
Conclusion

E must be settled before the target because its outgoing edge could have improved the target label; in this graph it produces 9, which is discarded in favor of 7.

Settle B, compare 8 with 7, then finalize university

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "it looks like at B, we've got some sixes here"

  2. Audio
    Observation

    "from B, we can get to the university, six plus two is eight"

  3. Audio
    Observation

    "we've got a seven and an eight here, so cross out the eight"

  4. Diagram
    Observation

    B is circled with 6, 8 is written at university and crossed out, then 7 is circled.

Uncertainties
  1. The phrase "some sixes here" is audible but the exact reason for the plural is not fully explained in the clip.

Visual argument
Steps
  1. Expression
    d(B)=6d(B)=6
    Explanation

    After E is handled, the smallest remaining uncircled label is 6 at B, so B is selected.

    Justification

    Audio identifies B as the next smallest uncircled vertex and the diagram circles 6 at B.

    Shown in the video
  2. Expression
    d(B)=d(A)+w(A,B)=2+4=6d(B)=d(A)+w(A,B)=2+4=6
    Explanation

    The selected label 6 at B is consistent with the earlier update from A.

    Justification

    Visible labels and edge weight 4 on A-B.

    Derived from the video
  3. Expression
    d(university)=d(B)+w(B,university)=6+2=8d(\text{university})=d(B)+w(B,\text{university})=6+2=8
    Explanation

    From B, the presenter computes a candidate 8 for university.

    Justification

    Audio says "six plus two is eight" and 8 is written at university.

    Shown in the video
  4. Expression
    8>78>7
    Explanation

    The candidate 8 is worse than the existing candidate 7, so 8 is crossed out.

    Justification

    Audio: "cross out the eight because that is larger than seven."

    Shown in the video
  5. Expression
    d(university)=7d(\text{university})=7
    Explanation

    With no smaller uncircled candidate left, the label 7 at university is circled as final.

    Justification

    Audio: "now finally we've got this seven here is the smallest uncircled vertex" and the diagram circles 7.

    Shown in the video
Conclusion

Processing B cannot improve the target because it gives 8, so the previously seen 7 becomes the final shortest distance.

Backward reconstruction of the minimizing route

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "Working backwards from university, we've come from D ... following the arrow backwards from D, that's come from A ... and then following from A, that's come from home."

  2. Animation
    Observation

    Yellow highlight appears successively on D-university, A-D, and home-A.

Uncertainties
  1. The last spoken sentence is truncated after "When you're writing this out, it's".

Visual argument
Steps
  1. Expression
    university←D\text{university} \leftarrow D
    Explanation

    Start at the destination and follow its predecessor arrow back to D.

    Justification

    Audio and yellow highlight on edge D-university.

    Shown in the video
  2. Expression
    D←AD \leftarrow A
    Explanation

    Follow D's predecessor arrow back to A.

    Justification

    Audio and yellow highlight on edge A-D.

    Shown in the video
  3. Expression
    A←homeA \leftarrow \text{home}
    Explanation

    Follow A's predecessor arrow back to the source.

    Justification

    Audio and yellow highlight on edge home-A.

    Shown in the video
  4. Expression
    home→A→D→university\text{home} \rightarrow A \rightarrow D \rightarrow \text{university}
    Explanation

    Reverse the backward chain to state the path in forward order.

    Justification

    Derived from the observed predecessor sequence.

    Derived from the video
Conclusion

The predecessor pointers identify the shortest path as home → A→DA \to D → university.

Deriving the Shortest Path and its Total Distance

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Speaker narrates the process of tracing the path backwards and summing the distance.

  2. Diagram
    Observation

    Visual highlighting of the path and writing of the sequence 'home - A - D - university (7)'.

Visual argument
Steps
  1. Expression
    Explanation

    Start at the destination node 'university'.

    Justification

    Goal is to find the path to 'university'.

    Shown in the video
  2. Expression
    Explanation

    Trace backwards along the highlighted yellow edges to find the predecessor node 'D'.

    Justification

    Visual inspection of the graph shows the edge D -> university is part of the shortest path tree.

    Shown in the video
  3. Expression
    Explanation

    Continue tracing backwards from 'D' to its predecessor 'A'.

    Justification

    Visual inspection shows the edge A -> D is part of the shortest path tree.

    Shown in the video
  4. Expression
    Explanation

    Trace backwards from 'A' to the starting node 'home'.

    Justification

    Visual inspection shows the edge home -> A is part of the shortest path tree.

    Shown in the video
  5. Expression
    Explanation

    Write the full path sequence: home - A - D - university.

    Justification

    Combining the traced steps gives the complete shortest path.

    Shown in the video
  6. Expression
    2+2+3=72 + 2 + 3 = 7
    Explanation

    Calculate the total distance by summing the weights of the edges along the path (home->A is 2, A->D is 2, D->university is 3).

    Justification

    Definition of path length in a weighted graph.

    Derived from the video
Conclusion

The shortest path is home - A - D - university, and its minimum distance is 7.

Worked examples · 3

Shortest Path from Home to University

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A weighted graph with vertices home, university, A, B, C, D, E.

  2. Audio
    Observation

    In this case we want to find the shortest path from home to university.

Problem

Find the shortest path from the 'home' vertex to the 'university' vertex in the given weighted network.

Given
  1. Weighted undirected graph with vertices: home, university, A, B, C, D, E.

  2. Edge weights: home-A=2, home-C=3, A−B=4A-B=4, A−C=2A-C=2, A−D=2A-D=2, B−D=2B-D=2, B-university=2, C−E=1C-E=1, D-university=3, E-university=5.

Goal

Determine the sequence of vertices and total weight of the shortest path.

Steps
  1. Expression
    Initialize:circle′home′,setd(home)=0.Initialize: circle 'home', set d(home)=0.
    Explanation

    Start the algorithm at the source vertex.

    Justification

    Base case for Dijkstra's algorithm.

    Shown in the video
  2. Expression
    Updateneighborsof′home′:d(A)=2,d(C)=3.Update neighbors of 'home': d(A)=2, d(C)=3.
    Explanation

    Calculate initial distances from the source.

    Justification

    Add edge weights to d(home).

    Shown in the video
  3. Expression
    Selectminuncircled:circle′A′(d=2),drawarrowfrom′home′.Select min uncircled: circle 'A' (d=2), draw arrow from 'home'.
    Explanation

    Choose the closest unvisited vertex.

    Justification

    2<32 < 3.

    Shown in the video
  4. Expression
    Updateneighborsof′A′:d(B)=6,d(D)=4,d(C)=min(3,4)=3.Update neighbors of 'A': d(B)=6, d(D)=4, d(C)=min(3, 4)=3.
    Explanation

    Recalculate distances through 'A'.

    Justification

    2+4=62+4=6, 2+2=42+2=4, 2+2=42+2=4. Keep minimum for C.

    Shown in the video
  5. Expression
    Selectminuncircled:circle′C′(d=3),drawarrowfrom′home′.Select min uncircled: circle 'C' (d=3), draw arrow from 'home'.
    Explanation

    Choose the next closest unvisited vertex.

    Justification

    3<43 < 4, 6.

    Shown in the video
  6. Expression
    Updateneighborsof′C′:d(E)=4.Update neighbors of 'C': d(E)=4.
    Explanation

    Recalculate distances through 'C'.

    Justification

    3+1=43+1=4.

    Shown in the video
  7. Expression
    Selectminuncircled:circle′D′(d=4),drawarrowfrom′A′.Select min uncircled: circle 'D' (d=4), draw arrow from 'A'.
    Explanation

    Choose the next closest unvisited vertex. Tie between D and E broken arbitrarily.

    Justification

    4 <= 4, 6.

    Shown in the video
Answer

The algorithm is still running at the end of the clip. The shortest path found so far leads to D with distance 4.

Verification

Visual tracking of circled vertices and arrows confirms the path construction.

Worked shortest-path example from home to university

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A weighted graph with vertices home, A, B, C, D, E, university is worked step by step.

  2. Audio
    Observation

    The speaker narrates label updates, crossings-out, selection of the smallest uncircled vertex, and final path reconstruction.

Uncertainties
  1. The very first words are fragmentary, and the final sentence is cut off after "When you're writing this out, it's".

Problem

Find the shortest distance and route from home to university in the displayed weighted graph using the demonstrated version of Dijkstra's algorithm.

Given
  1. Initial visible settled labels: home = 0, A=2A = 2, C=3C = 3, D=4D = 4.

  2. Visible edge weights include home-A = 2, home-C = 3, C−A=2C-A = 2, C−E=1C-E = 1, A−B=4A-B = 4, A−D=2A-D = 2, A-university = 3, B−D=2B-D = 2, B-university = 2, D-university = 3, E-university = 5.

  3. E begins with uncircled label 4.

  4. University begins with candidate label 7 before the clip's later updates.

Goal

Determine the final shortest distance from home to university.;Determine the corresponding shortest path.

Steps
  1. Expression
    d(B)=2+4=6d(B)=2+4=6
    Explanation

    From A, compute a candidate label 6 for B.

    Justification

    Audio: "four plus two is six" with visible labels and edge weight.

    Shown in the video
  2. Expression
    d(university)=7d(\text{university})=7
    Explanation

    A candidate label 7 is already present at university from the route through D.

    Justification

    Visible label 7 and audio "four plus three is seven"; the arithmetic matches D→university rather than A→university.

    Shown in the video
  3. Expression
    select E because 4<7\text{select }E\text{ because }4<7
    Explanation

    Do not finish at university yet; choose the smallest uncircled vertex, E with label 4.

    Justification

    Audio explicitly says the smallest uncircled vertex is "this other four down here".

    Shown in the video
  4. Expression
    d(university)=4+5=9d(\text{university})=4+5=9
    Explanation

    From E, compute a candidate 9 for university.

    Justification

    Audio: "that is nine to the university" and visible edge weight 5 on E-university.

    Shown in the video
  5. Expression
    keep 7, discard 9\text{keep }7\text{, discard }9
    Explanation

    Compare 9 with the existing 7 and cross out 9.

    Justification

    Audio: "we're going to cross out nine because that's not the smallest."

    Shown in the video
  6. Expression
    select B with 6\text{select }B\text{ with }6
    Explanation

    Next choose the smallest uncircled vertex, B with label 6.

    Justification

    Audio identifies B as the next smallest uncircled vertex and the diagram circles 6.

    Shown in the video
  7. Expression
    d(university)=6+2=8d(\text{university})=6+2=8
    Explanation

    From B, compute a candidate 8 for university.

    Justification

    Audio: "six plus two is eight" and visible edge weight 2 on B-university.

    Shown in the video
  8. Expression
    keep 7, discard 8\text{keep }7\text{, discard }8
    Explanation

    Compare 8 with 7 and cross out 8.

    Justification

    Audio: "cross out the eight because that is larger than seven."

    Shown in the video
  9. Expression
    d(university)=7 finald(\text{university})=7\text{ final}
    Explanation

    Circle 7 at university as the final shortest distance.

    Justification

    Audio: "that tells us that the shortest distance from home to university is seven."

    Shown in the video
  10. Expression
    path=home→A→D→university\text{path}=\text{home}\rightarrow A\rightarrow D\rightarrow \text{university}
    Explanation

    Follow predecessor arrows backward from university to recover the route.

    Justification

    Audio and yellow backward highlighting from university to D to A to home.

    Shown in the video
Answer

Shortest distance = 7; shortest path = home → A→DA \to D → university.

Verification

The answer is verified inside the clip by comparing all later candidate labels at university (9 from E and 8 from B) against 7 and by tracing the recorded predecessor arrows backward from university to home.

Finding the Shortest Path in a Weighted Graph

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A weighted graph with nodes home, A, B, C, D, E, university.

  2. Audio
    Observation

    Speaker explains how to find the shortest path from home to university.

Problem

Given a weighted graph representing locations and travel times, find the shortest path from 'home' to 'university' and its total distance.

Given
  1. A graph with vertices: home, A, B, C, D, E, university.

  2. Edge weights representing distances/times.

  3. Pre-computed shortest distances to each node (indicated by blue circles).

Goal

Identify the sequence of nodes forming the shortest path and calculate its total weight.

Steps
  1. Expression
    Explanation

    Observe the highlighted yellow path on the graph.

    Justification

    The visual aid indicates the optimal route.

    Shown in the video
  2. Expression
    Explanation

    Trace the path backwards from 'university' to 'home': university <- D<−AD <- A <- home.

    Justification

    Following the directed edges of the shortest path tree.

    Shown in the video
  3. Expression
    Explanation

    Write the forward path: home - A - D - university.

    Justification

    Reversing the backward trace to get the logical order.

    Shown in the video
  4. Expression
    2+2+3=72 + 2 + 3 = 7
    Explanation

    Sum the weights of the edges: (home, A)=2, (A, D)=2, (D, university)=3.

    Justification

    Calculation of total path cost.

    Derived from the video
Answer

Path: home - A - D - university; Minimum distance: 7.

Verification

The sum of the edge weights matches the final distance value written by the speaker.

Visual events · 11

Network Graph Display

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Static weighted graph with 7 vertices and 10 edges.

Objects
  1. Vertices: home, university, A, B, C, D, E

  2. Edges with numerical weights

Changes
  1. Blue annotations (numbers, circles, arrows, cross-outs) are added sequentially over time.

Invariants
  1. The underlying graph structure and edge weights remain constant.

Interpretation

The visual changes represent the step-by-step execution of Dijkstra's algorithm on the fixed network.

Initial graph state at the start of the clip

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The graph shows circled labels 0 at home, 2 at A, 3 at C, and 4 at D; E has uncircled 4; university has uncircled 7; B has uncircled 6.

Objects
  1. weighted graph

  2. vertices home, A, B, C, D, E, university

  3. circled labels 0, 2, 3, 4

  4. uncircled labels 6, 4, 7

  5. blue predecessor arrows

Changes
  1. Candidate labels 6 at B and 7 at university are visible from updates associated with A and D.

Invariants
  1. Edge weights remain fixed.

  2. Already circled labels 0, 2, 3, and 4 do not change.

Interpretation

The clip begins mid-run, after several vertices have already been settled and after candidate labels have been propagated to B and university.

Selection of E as the next vertex

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The uncircled 4 at E is circled in blue.

  2. Animation
    Observation

    A blue arrow is drawn from C to E.

Objects
  1. vertex E

  2. label 4 at E

  3. vertex C

  4. edge C-E

Changes
  1. E changes from uncircled to circled.

  2. A predecessor arrow C→EC\to E is added.

Invariants
  1. The label value 4 at E does not change.

  2. Other settled labels remain unchanged.

Interpretation

Because 4 at E is the smallest uncircled label, E is settled before the target label 7 can be accepted.

Visual emphasis on the possible E-to-university improvement

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A red rectangular outline encloses E, the edge E-university, and university.

Objects
  1. vertex E

  2. edge E-university

  3. vertex university

  4. red rectangle

Changes
  1. The region involving E and university is highlighted in red.

Invariants
  1. No numerical label is changed by the red box itself.

  2. The edge weight remains 5.

Interpretation

The highlight supports the spoken counterfactual explanation that a smaller edge from E to university could have beaten the current target label 7.

Candidate 9 from E is generated and rejected

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    A 9 is written at university below the existing 7.

  2. Diagram
    Observation

    The 9 is then crossed out.

Objects
  1. vertex university

  2. labels 7 and 9

  3. edge E-university

Changes
  1. A new candidate label 9 appears at university.

  2. The 9 is crossed out while 7 remains.

Invariants
  1. The existing label 7 stays visible.

  2. The edge weight E-university remains 5.

Interpretation

The update from E gives 4+5=94 + 5 = 9, which is worse than the current best 7, so it is discarded.

Selection of B as the next vertex

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The label 6 at B is circled.

  2. Animation
    Observation

    A blue arrow from A to B is drawn.

Objects
  1. vertex B

  2. label 6 at B

  3. vertex A

  4. edge A-B

Changes
  1. B changes from uncircled to circled.

  2. A predecessor arrow A→BA\to B is added.

Invariants
  1. The value 6 at B is unchanged.

  2. Previously settled labels remain fixed.

Interpretation

After E is handled, B has the smallest remaining uncircled label and is therefore settled next.

Candidate 8 from B is generated and rejected

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    An 8 is written at university near the existing 7.

  2. Diagram
    Observation

    The 8 is crossed out.

Objects
  1. vertex university

  2. labels 7 and 8

  3. edge B-university

Changes
  1. A new candidate label 8 appears at university.

  2. The 8 is crossed out while 7 remains.

Invariants
  1. The label 7 remains the best candidate.

  2. The edge weight B-university remains 2.

Interpretation

The update from B gives 6+2=86 + 2 = 8, which is larger than 7, so the target label is not improved.

Finalization of the destination label

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The label 7 at university is circled in blue.

Objects
  1. vertex university

  2. label 7

Changes
  1. The uncircled 7 at university becomes circled.

Invariants
  1. No new candidate replaces 7.

  2. All smaller uncircled vertices have already been processed.

Interpretation

The destination label 7 is now accepted as the shortest distance from home to university.

Backward path highlighting

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    Yellow highlighting appears on D-university, then A-D, then home-A.

  2. Audio
    Observation

    The speaker narrates the backward route from university to D to A to home.

Objects
  1. edges D-university, A-D, home-A

  2. vertices university, D, A, home

  3. yellow highlight

Changes
  1. Edges are highlighted one by one in reverse order from the destination toward the source.

Invariants
  1. The underlying graph and labels do not change during the highlighting.

  2. The highlighted edges correspond to the recorded predecessor arrows.

Interpretation

The animation visually reconstructs the shortest path by following predecessor pointers backward, yielding home → A→DA \to D → university.

Highlighting the Shortest Path

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Edges home->A, A->D, and D->university are highlighted in thick yellow.

Objects
  1. Graph edges

Changes
  1. Specific edges are colored yellow to distinguish them from the rest of the graph.

Invariants
  1. The underlying graph structure remains unchanged.

Interpretation

The yellow highlight visually represents the sequence of edges that constitute the shortest path found by the algorithm.

Writing the Path Sequence

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    Handwritten text appears sequentially at the bottom of the screen: 'university', then '- D - university', then '- A - D - university', then 'home - A - D - university', and finally '(7)'.

Objects
  1. Text labels

Changes
  1. Text is added incrementally to build the final path string.

Invariants
  1. The graph diagram above remains static.

Interpretation

This animation demonstrates the process of reconstructing the path by tracing backwards from the destination and then writing it out in the correct forward order, concluding with the total distance.

Misconceptions · 3

Keeping Multiple Distance Values

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Whenever we have two or more numbers at a vertex, we're going to cross out any number that isn't equal to the minimum.

Misconception

Students might leave multiple distance values at a single vertex, leading to confusion in later steps.

Clarification

Only the minimum distance value should be kept; all larger values must be explicitly crossed out.

Mistakenly treating the first target label as final

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "Now, we don't just conclude that seven must be the shortest distance because we've still got some other vertices to consider."

  2. Audio
    Observation

    "The reason why we couldn't just circle that seven straight away is if the edge from E to university had just been one or two, then that would actually give us a shorter path."

Misconception

Once a number appears at the destination, one might think it is already the shortest distance and stop immediately.

Clarification

The clip explicitly shows that 7 at university is not circled right away because a smaller uncircled vertex E with label 4 still has to be processed; only after all smaller candidates are handled can the target label be finalized.

Assuming one visible route already proves optimality

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Hypothetical discussion of the edge from E to university being 1 or 2.

  2. Diagram
    Observation

    Later candidates 9 and 8 are written at university and compared against 7.

Misconception

One might assume that a single route to the destination determines the answer without checking other unsettled branches.

Clarification

The worked example checks alternate routes through E and B, producing 9 and 8, and rejects both because they are larger than 7.

Concept relations · 9

Initialization Step → Updating Neighbors

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Sequential explanation of initialization followed by updating neighbors.

Prerequisite
Explanation

The initialization step must be completed before neighbor updates can begin.

Updating Neighbors → Selecting the Next Vertex

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Sequential explanation of updating neighbors followed by selecting the minimum.

Prerequisite
Explanation

Neighbors must be updated with new distances before the algorithm can select the next vertex to visit.

Updating Neighbors → Handling Multiple Distances

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Explanation of crossing out larger numbers immediately after calculating multiple distances to C.

Application
Explanation

The rule for crossing out larger numbers is applied as a direct consequence of the neighbor update step when multiple paths reach the same vertex.

Select the smallest uncircled vertex before finishing → Shortest distance from home to university

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    The speaker first insists on processing the smallest uncircled vertex and only later circles 7 at university.

  2. Diagram
    Observation

    E and B are settled before university.

Proof dependency
Explanation

The final distance 7 depends on first applying the rule that the smallest uncircled vertex must be processed before the target can be declared finished.

Predecessor arrows record the route that produced a label → Reconstruct the shortest path by following predecessor arrows backward

Clear evidence
Derived from the video
Evidence
  1. Diagram
    Observation

    Predecessor arrows are drawn during the run.

  2. Audio
    Observation

    The final path is obtained by "following the arrow backwards".

Proof dependency
Explanation

Path reconstruction depends on the earlier recording of predecessor arrows; without those arrows, the backward route could not be recovered.

Meaning of the numeric vertex labels in this worked example → Select the smallest uncircled vertex before finishing

Clear evidence
Derived from the video
Evidence
  1. Diagram
    Observation

    All algorithm actions are driven by comparing numeric vertex labels.

  2. Audio
    Observation

    The speaker repeatedly refers to labels as distances.

Prerequisite
Explanation

The rule for choosing the next vertex presupposes understanding that each numeric label represents a current distance estimate from the source.

Worked shortest-path example from home to university → Select the smallest uncircled vertex before finishing

Clear evidence
Derived from the video
Evidence
  1. Diagram
    Observation

    The whole clip is a single worked graph example.

  2. Audio
    Observation

    The narration applies the selection and update rules concretely.

Application
Explanation

The worked example instantiates the general method of selecting the smallest uncircled vertex and updating neighboring candidates.

Why E must be checked before accepting 7 → Mistakenly treating the first target label as final

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    The hypothetical edge weight 1 or 2 from E to university is used to explain why 7 cannot be circled immediately.

Contrast
Explanation

The hypothetical shorter route through E contrasts with the mistaken idea that the first target label can be accepted immediately.

Path Backtracking in Shortest Path Algorithms → Reporting Minimum Distance

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Speaker transitions from describing the path to stating the minimum distance.

Application
Explanation

Once the path is identified via backtracking, the minimum distance is calculated by summing the weights of the edges along that specific path.

Find an answer · 11

How do you initialize Dijkstra's algorithm?

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Explanation of putting a zero at the start vertex.

Knowledge points
  1. Initialization Step

Why do we circle the smallest uncircled number in Dijkstra's algorithm?

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Explanation of circling the smallest uncircled number.

Knowledge points
  1. Selecting the Next Vertex

What do you do if a vertex has multiple distance numbers written next to it?

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Rule for handling two or more numbers at a vertex.

Knowledge points
  1. Handling Multiple Distances

Why doesn't the presenter circle 7 at university immediately?

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "we don't just conclude that seven must be the shortest distance"

  2. Audio
    Observation

    "if the edge from E to university had just been one or two"

Knowledge points
  1. Select the smallest uncircled vertex before finishing
  2. Mistakenly treating the first target label as final

What do the numbers written at the vertices represent in this algorithm demo?

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Numbers are attached to vertices and compared throughout.

  2. Audio
    Observation

    "the distance from home to B is six"

Knowledge points
  1. Meaning of the numeric vertex labels in this worked example

Where do the candidate values 9 and 8 at university come from?

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "that is nine to the university"

  2. Audio
    Observation

    "six plus two is eight"

Knowledge points
  1. Meaning of the numeric vertex labels in this worked example
  2. Select the smallest uncircled vertex before finishing

What is the final shortest distance from home to university in this example?

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "the shortest distance from home to university is seven"

Knowledge points
  1. Shortest distance from home to university

How is the actual shortest path recovered after the distance is found?

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "Working backwards from university, we've come from D ... A ... home."

  2. Animation
    Observation

    Yellow highlighting traces the route backward.

Knowledge points
  1. Reconstruct the shortest path by following predecessor arrows backward
  2. Predecessor arrows record the route that produced a label

Why is vertex E processed before the destination is finalized?

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    "the smallest uncircled vertex is this other four down here"

  2. Diagram
    Observation

    E is circled before university is finalized.

Knowledge points
  1. Select the smallest uncircled vertex before finishing
  2. Mistakenly treating the first target label as final

How do I reconstruct the actual shortest path after running Dijkstra's algorithm?

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Explanation of working right to left to find the path.

Knowledge points
  1. Path Backtracking in Shortest Path Algorithms

How do I calculate the total distance of the shortest path in a weighted graph?

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    Statement about indicating the minimum distance.

Knowledge points
  1. Reporting Minimum Distance
Coverage and review notes

Covered · Introduction to Dijkstra's algorithm.

Covered · Problem statement: find shortest path from home to university.

Covered · Step 1: Initialize starting vertex.

Covered · Step 2: Update neighbors of the starting vertex.

Covered · Step 3: Select and circle the minimum uncircled vertex (A).

Covered · Step 4: Update neighbors of vertex A.

Covered · Step 5: Cross out the larger distance at vertex C.

Covered · Step 6: Select and circle the minimum uncircled vertex (C).

Covered · Step 7: Update neighbors of vertex C.

Covered · Step 8: Select and circle the minimum uncircled vertex (D).

Covered · Opening graph state and updates from A producing candidate labels at B and university.

Covered · Explanation that 7 is not final yet; E with label 4 is selected as the smallest uncircled vertex.

Covered · Red-box visual emphasis and hypothetical explanation about a shorter edge from E to university.

Covered · Computation of candidate 9 from E and crossing it out against 7.

Covered · Selection of B with label 6 and recording of predecessor arrow A→BA\to B.

Covered · Computation of candidate 8 from B and crossing it out against 7.

Covered · Final circling of 7 at university and statement of the shortest distance.

Covered · Backward traversal of predecessor arrows to recover the path home → A→DA \to D → university.

Covered · The entire clip covers the final steps of a shortest path problem: backtracking to find the route and summing the weights for the total distance.

Explore the knowledge in this video

Reviewed subject paths

Questions this video answers

Meet the concept

↗
Understand why

↗
Find a method

↗
Find a method

↗
Meet the concept

↗
Meet the concept

↗
Meet the concept

↗
Find a method

↗