This page assumes you have seen nothing. Before you can read the parent note Floyd-Warshall, you must own every symbol it throws at you. We will build each one from a picture. Nothing is used before it is defined.
In the figure the direct road 0→2 costs 11, but the detour 0→1→2 costs 4+2=6. So d(0,2)=6, not 11. A detour can beat the direct road — that single fact is the engine of the whole algorithm.
Everything Floyd-Warshall computes is built from just these two moves.
Put the two tools together and you get the heart of the parent note:
d[i][j]←min(d[i][j],d[i][k]+d[k][j])
In words: "Is stopping at k cheaper than my current best? If so, adopt it."
V = the set of vertices (dots / cities); E = the set of edges (arrows / roads).
What does a directed edge i→j allow, and not allow?
Travel from i to j only; it does not grant travel from j to i.
What is w(i,j)?
The cost (weight) written on the road from i to j.
What is the length of the path 0→1→2?
w(0,1)+w(1,2) — the sum of the weights of the roads used.
What does d(i,j) mean?
The length of the shortest path from i to j.
Why do we initialise unknown distances to ∞?
So any real path is smaller and will replace it; ∞ means "no known road yet."
Why is d[i][i] set to 0 at the start?
The distance from a city to itself is zero — you are already there.
What does min(a,b) do and why is it the right tool?
Returns the smaller value; "best route" means cheapest, so we keep the smaller cost.
When you split a path through k, what is its cost?
d(i,k)+d(k,j) — cost to reach k plus cost onward from k.
Read dk(i,j) aloud in plain words.
Shortest distance from i to j using only cities 1 through k as intermediate stops.
What is the difference between a negative edge and a negative cycle?
A negative edge is a single cost-reducing road (allowed); a negative cycle is a loop whose weights sum below zero (forbidden — makes shortest path undefined).
How would you spot a negative cycle after running the algorithm?
Some diagonal entry d[i][i] becomes less than 0.
Now you own every symbol. Return to the parent note and the recurrence will read like plain English.