Reviewed learning material · Video analysis · EnglishRead 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→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.
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=6.
The distance to D is calculated as 2+2=4.
An alternative distance to C is calculated as 2+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=3, D=4, B=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=4.
With uncircled vertices B=6, D=4, and E=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=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=9. The number 9 is written at university and then crossed out because 9>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=8. The candidate 8 is written at university and then crossed out because 8>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→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+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)=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.
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→E records how E got label 4, and A→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=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=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=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=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→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=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
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
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
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
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
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
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
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
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
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
Diagram
Observation
Vertex A is already circled with label 2 at the start of the clip.
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
Diagram
Observation
Vertex B first shows candidate label 6, then is circled with 6.
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
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
The network must have non-negative edge weights.
Initialization Step
Clear evidence
Shown in the video
Evidence
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.
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
Applies to the starting vertex of the path.
Prerequisites
Dijkstra's Algorithm
Updating Neighbors
Clear evidence
Shown in the video
Evidence
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.
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
Only applies to neighbors that are not yet circled.
Prerequisites
Initialization Step
Selecting the Next Vertex
Clear evidence
Shown in the video
Evidence
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.
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
Applies when there are uncircled vertices with assigned distances.
Prerequisites
Updating Neighbors
Handling Multiple Distances
Clear evidence
Shown in the video
Evidence
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.
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
Occurs when a vertex is reachable via multiple paths from different circled vertices.
Prerequisites
Updating Neighbors
Select the smallest uncircled vertex before finishing
Clear evidence
Shown in the video
Evidence
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"
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
The graph is being processed by the displayed shortest-path method.
Vertices with circled labels are treated as already selected.
Uncircled labels are still candidates.
Prerequisites
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
Diagram
Observation
Numeric labels accumulate at vertices and are compared across the graph.
Audio
Observation
The speaker interprets labels as distances, e.g. "the distance from home to B is six".
Uncertainties
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
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
Audio
Observation
"circle that now and indicate where that has come from"
Diagram
Observation
Arrows are drawn from A to B, from C to E, and from D to university.
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
Used when a new best label is assigned or when a selected vertex needs its predecessor recorded.
Prerequisites
Meaning of the numeric vertex labels in this worked example
Shortest distance from home to university
Clear evidence
Shown in the video
Evidence
Audio
Observation
"And now finally we've got this seven here is the smallest uncircled vertex"
Audio
Observation
"that tells us that the shortest distance from home to university is seven."
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
All relevant vertices with smaller tentative labels have already been processed.
Prerequisites
Select the smallest uncircled vertex before finishing
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
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."
Animation
Observation
Yellow highlighting traces university ← D ← A ← home in reverse order.
Uncertainties
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→D → university.
Formula
Conditions
Predecessor arrows must have been recorded during the label updates.
Prerequisites
Predecessor arrows record the route that produced a label
Shortest distance from home to university
Path Backtracking in Shortest Path Algorithms
Clear evidence
Shown in the video
Evidence
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'.
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
The shortest distances and predecessors for all nodes must have been previously computed.
Reporting Minimum Distance
Clear evidence
Shown in the video
Evidence
Audio
Observation
Speaker states: 'you should also indicate what the distance was and the minimum distance was seven'.
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
The shortest path has been identified.
Prerequisites
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
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
The graph contains multiple uncircled vertices.
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
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
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
The settled distance to E is 4.
The edge under consideration connects E to university.
Quantifiers
For edge weights w(E, university) ∈ {1, 2}, the resulting candidate distance 4+w is less than 7.
Final shortest distance in the example
Clear evidence
Shown in the video
Evidence
Audio
Observation
"that tells us that the shortest distance from home to university is seven."
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
The displayed edge weights are fixed.
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
Audio
Observation
"Working backwards from university, we've come from D ... that's come from A ... that's come from home."
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→D → university.
Hypotheses
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→D → university.
Derivations and proofs · 8
First Iteration Neighbor Update
Clear evidence
Shown in the video
Evidence
Audio
Observation
So we can go to A, which is two away, and we can go to C, which is three away.
Animation
Observation
Numbers 2 and 3 appear next to A and C.
Visual argument
Steps
Expression
d(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
Expression
d(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
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.
Animation
Observation
Numbers 6, 4, and 4 appear next to B, D, and C.
Visual argument
Steps
Expression
d(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
Expression
d(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
Expression
d(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
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.
Animation
Observation
Number 4 appears next to E.
Visual argument
Steps
Expression
d(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
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."
Diagram
Observation
Candidate labels 6 at B and 7 at university appear after processing from A.
Uncertainties
The opening words are fragmentary, but the arithmetic and resulting labels are clear.
Visual argument
Steps
Expression
d(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
Expression
d(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
Expression
d(university)=d(A)+w(A,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
Expression
d(university)=d(D)+w(D,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
Audio
Observation
"the smallest uncircled vertex is this other four down here"
Audio
Observation
"looking at the E, we've got four there, and that is nine to the university"
Diagram
Observation
E is circled with 4, then 9 is written at university and crossed out against 7.
Visual argument
Steps
Expression
min{uncircled labels}=4 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
Expression
d(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→E.
Derived from the video
Expression
d(university)=d(E)+w(E,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
Expression
9>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
Audio
Observation
"it looks like at B, we've got some sixes here"
Audio
Observation
"from B, we can get to the university, six plus two is eight"
Audio
Observation
"we've got a seven and an eight here, so cross out the eight"
Diagram
Observation
B is circled with 6, 8 is written at university and crossed out, then 7 is circled.
Uncertainties
The phrase "some sixes here" is audible but the exact reason for the plural is not fully explained in the clip.
Visual argument
Steps
Expression
d(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
Expression
d(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
Expression
d(university)=d(B)+w(B,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
Expression
8>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
Expression
d(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
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."
Animation
Observation
Yellow highlight appears successively on D-university, A-D, and home-A.
Uncertainties
The last spoken sentence is truncated after "When you're writing this out, it's".
Visual argument
Steps
Expression
university←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
Expression
D←A
Explanation
Follow D's predecessor arrow back to A.
Justification
Audio and yellow highlight on edge A-D.
Shown in the video
Expression
A←home
Explanation
Follow A's predecessor arrow back to the source.
Justification
Audio and yellow highlight on edge home-A.
Shown in the video
Expression
home→A→D→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→D → university.
Deriving the Shortest Path and its Total Distance
Clear evidence
Shown in the video
Evidence
Audio
Observation
Speaker narrates the process of tracing the path backwards and summing the distance.
Diagram
Observation
Visual highlighting of the path and writing of the sequence 'home - A - D - university (7)'.
Visual argument
Steps
Expression
Explanation
Start at the destination node 'university'.
Justification
Goal is to find the path to 'university'.
Shown in the video
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
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
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
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
Expression
2+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
Diagram
Observation
A weighted graph with vertices home, university, A, B, C, D, E.
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
Weighted undirected graph with vertices: home, university, A, B, C, D, E.
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
Diagram
Observation
A weighted graph with nodes home, A, B, C, D, E, university.
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
A graph with vertices: home, A, B, C, D, E, university.
Edge weights representing distances/times.
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
Expression
Explanation
Observe the highlighted yellow path on the graph.
Justification
The visual aid indicates the optimal route.
Shown in the video
Expression
Explanation
Trace the path backwards from 'university' to 'home': university <- D<−A <- home.
Justification
Following the directed edges of the shortest path tree.
Shown in the video
Expression
Explanation
Write the forward path: home - A - D - university.
Justification
Reversing the backward trace to get the logical order.
Shown in the video
Expression
2+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
Diagram
Observation
Static weighted graph with 7 vertices and 10 edges.
Objects
Vertices: home, university, A, B, C, D, E
Edges with numerical weights
Changes
Blue annotations (numbers, circles, arrows, cross-outs) are added sequentially over time.
Invariants
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
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
weighted graph
vertices home, A, B, C, D, E, university
circled labels 0, 2, 3, 4
uncircled labels 6, 4, 7
blue predecessor arrows
Changes
Candidate labels 6 at B and 7 at university are visible from updates associated with A and D.
Invariants
Edge weights remain fixed.
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
Diagram
Observation
The uncircled 4 at E is circled in blue.
Animation
Observation
A blue arrow is drawn from C to E.
Objects
vertex E
label 4 at E
vertex C
edge C-E
Changes
E changes from uncircled to circled.
A predecessor arrow C→E is added.
Invariants
The label value 4 at E does not change.
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
Diagram
Observation
A red rectangular outline encloses E, the edge E-university, and university.
Objects
vertex E
edge E-university
vertex university
red rectangle
Changes
The region involving E and university is highlighted in red.
Invariants
No numerical label is changed by the red box itself.
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
Diagram
Observation
A 9 is written at university below the existing 7.
Diagram
Observation
The 9 is then crossed out.
Objects
vertex university
labels 7 and 9
edge E-university
Changes
A new candidate label 9 appears at university.
The 9 is crossed out while 7 remains.
Invariants
The existing label 7 stays visible.
The edge weight E-university remains 5.
Interpretation
The update from E gives 4+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
Diagram
Observation
The label 6 at B is circled.
Animation
Observation
A blue arrow from A to B is drawn.
Objects
vertex B
label 6 at B
vertex A
edge A-B
Changes
B changes from uncircled to circled.
A predecessor arrow A→B is added.
Invariants
The value 6 at B is unchanged.
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
Diagram
Observation
An 8 is written at university near the existing 7.
Diagram
Observation
The 8 is crossed out.
Objects
vertex university
labels 7 and 8
edge B-university
Changes
A new candidate label 8 appears at university.
The 8 is crossed out while 7 remains.
Invariants
The label 7 remains the best candidate.
The edge weight B-university remains 2.
Interpretation
The update from B gives 6+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
Diagram
Observation
The label 7 at university is circled in blue.
Objects
vertex university
label 7
Changes
The uncircled 7 at university becomes circled.
Invariants
No new candidate replaces 7.
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
Animation
Observation
Yellow highlighting appears on D-university, then A-D, then home-A.
Audio
Observation
The speaker narrates the backward route from university to D to A to home.
Objects
edges D-university, A-D, home-A
vertices university, D, A, home
yellow highlight
Changes
Edges are highlighted one by one in reverse order from the destination toward the source.
Invariants
The underlying graph and labels do not change during the highlighting.
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→D → university.
Highlighting the Shortest Path
Clear evidence
Shown in the video
Evidence
Diagram
Observation
Edges home->A, A->D, and D->university are highlighted in thick yellow.
Objects
Graph edges
Changes
Specific edges are colored yellow to distinguish them from the rest of the graph.
Invariants
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
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
Text labels
Changes
Text is added incrementally to build the final path string.
Invariants
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
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
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."
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
Audio
Observation
Hypothetical discussion of the edge from E to university being 1 or 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
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
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
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
Audio
Observation
The speaker first insists on processing the smallest uncircled vertex and only later circles 7 at university.
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
Diagram
Observation
Predecessor arrows are drawn during the run.
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
Diagram
Observation
All algorithm actions are driven by comparing numeric vertex labels.
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
Diagram
Observation
The whole clip is a single worked graph example.
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
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
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
Audio
Observation
Explanation of putting a zero at the start vertex.
Knowledge points
Initialization Step
Why do we circle the smallest uncircled number in Dijkstra's algorithm?
Clear evidence
Derived from the video
Evidence
Audio
Observation
Explanation of circling the smallest uncircled number.
Knowledge points
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
Audio
Observation
Rule for handling two or more numbers at a vertex.
Knowledge points
Handling Multiple Distances
Why doesn't the presenter circle 7 at university immediately?
Clear evidence
Shown in the video
Evidence
Audio
Observation
"we don't just conclude that seven must be the shortest distance"
Audio
Observation
"if the edge from E to university had just been one or two"
Knowledge points
Select the smallest uncircled vertex before finishing
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
Diagram
Observation
Numbers are attached to vertices and compared throughout.
Audio
Observation
"the distance from home to B is six"
Knowledge points
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
Audio
Observation
"that is nine to the university"
Audio
Observation
"six plus two is eight"
Knowledge points
Meaning of the numeric vertex labels in this worked example
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
Audio
Observation
"the shortest distance from home to university is seven"
Knowledge points
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
Audio
Observation
"Working backwards from university, we've come from D ... A ... home."
Animation
Observation
Yellow highlighting traces the route backward.
Knowledge points
Reconstruct the shortest path by following predecessor arrows backward
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
Audio
Observation
"the smallest uncircled vertex is this other four down here"
Diagram
Observation
E is circled before university is finalized.
Knowledge points
Select the smallest uncircled vertex before finishing
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
Audio
Observation
Explanation of working right to left to find the path.
Knowledge points
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
Audio
Observation
Statement about indicating the minimum distance.
Knowledge points
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→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→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.
The final shortest distance from home to university is 7. This value is determined after all smaller uncircled candidates (specifically vertices E with label 4 and B with label 6) have been processed.
Conditions: The algorithm has processed all vertices with tentative labels smaller than 7.; The label 7 at university is the smallest remaining uncircled label.; The graph edge weights are fixed as shown in the example.
The algorithm does not finalize the destination label 7 at university immediately because there are still other uncircled vertices with smaller tentative distances that must be processed first. Specifically, vertex E has an uncircled label of 4, which is smaller than 7.
Conditions: The graph is being processed by Dijkstra's algorithm.; Vertices with circled labels are treated as already selected/settled.; Uncircled labels are still tentative candidates.; There exists at least one uncircled vertex with a label smaller than the target's current label.
To update the neighbors, you calculate the total distance from the source to each unvisited neighbor by adding the edge weight to the current circled vertex's distance. You then write these new distances next to the neighbors.
Conditions: There is a current circled (settled) vertex.; The vertex has neighbors that are not yet circled.; Edge weights are known and non-negative.
When a vertex receives multiple distance calculations from different paths, you keep only the smallest value and cross out the larger ones. This ensures that the vertex's label always represents the shortest known distance from the source.
Conditions: A vertex is reachable via multiple paths from different circled vertices.; New distance calculations are performed for an already labeled vertex.
The initialization step involves assigning a distance of 0 to the starting vertex (home) and marking it as visited by drawing a circle around it. All other vertices are initially considered to have an infinite or undefined distance until they are updated by neighbor calculations.
Conditions: The algorithm is starting.; The source vertex is identified as 'home'.
The numeric labels at the vertices represent the current best known distance from the source vertex (home) to that specific vertex. A blue circle around a label indicates that this distance has been accepted as final for that vertex in the current run of the algorithm.
Conditions: The demonstration uses a visual whiteboard-style representation.; The source vertex is 'home'.; The algorithm is Dijkstra's shortest path algorithm.
The rule is to select the uncircled vertex with the smallest tentative distance label. This vertex is then circled to mark it as settled, and a predecessor arrow is drawn from the vertex that supplied this smallest distance.
Conditions: There are uncircled vertices with assigned distance labels.; The algorithm is in the selection phase after updating neighbors.
To reconstruct the shortest path, you follow the predecessor arrows backward from the destination vertex to the source vertex. During the algorithm's execution, whenever a vertex is selected or updated, an arrow is drawn from the vertex that supplied the current best label.
Conditions: Predecessor arrows must have been recorded during the label updates.; The destination label has been finalized (circled).; The graph is directed or treated as such for the purpose of following the recorded arrows.