Escape route planning [00TR]
As another example application for finding max flows, imagine trying to plan escape routes for evacuating a city. Formally, we model a city as a directed graph. Each vertex has a weight corresponding to the number of people who start there (for example, we might assign every vertex some number corresponding to population density; or if we are trying to model evacuation from large events we might just assign a few vertices some large number, etc.). Certain vertices are designated as "escapes" (which could correspond to shelters, or simply to vertices on the edge of the graph), each having a capacity corresponding to the number of people it can handle. Each edge also has a capacity corresponding to how many people it can handle. The goal is to see how many people we can get from their starting locations to an escape, and plan which routes they should use.
Once again, we can make this into a flow network as follows:
- Create a source vertex s, and add an edge from s to each vertex v with capacity equal to the number of people that start at v.
- Create a sink vertex t, and add an edge from each escape vertex to t with capacity equal to the capacity of the escape.