Open a ride-sharing app in Dhaka and ask for a trip from Mirpur to Motijheel. In less than a second it shows one route and one price. Behind that answer, the city is a drawing of dots and lines, and the app has picked, out of thousands of possible routes, the one with the smallest total time. The same night a power company wants to lay cable so that every upazila office is connected, and it wants to buy the least cable that does the job. And a gas company wants to know how much gas per hour can actually reach Dhaka through pipes that each carry only so much. Three different questions, one kind of picture: dots, lines and numbers on the lines.
The last chapter ended with a promise. Dynamic programming stores answers, and one famous graph algorithm, Floyd-Warshall, is a dynamic program in disguise. We start from there, but we go wider. This chapter takes the three questions above and answers each one properly: the cheapest route (shortest paths), the cheapest way to connect everything (minimum spanning tree) and the most that can flow through a network (maximum flow).
By the end you will be able to say, for any graph, which shortest-path algorithm to use and why. You will run Dijkstra, Bellman-Ford and Floyd-Warshall by hand and in C, explain why a negative edge breaks one of them and how another catches a negative cycle, and rebuild the actual route, not only its cost. You will build a minimum spanning tree with Kruskal and with Prim and count how many such trees a graph can have. And you will find a maximum flow by augmenting paths and prove it is the maximum by pointing at a minimum cut.
We go in seven parts, easy to hard: what a shortest path is and the one move all the algorithms share; Dijkstra; negative edges and Bellman-Ford; every pair at once with Floyd-Warshall; spanning trees; maximum flow; and finally how to choose, and how to answer in an exam.