CS252 Algorithms Monday, 7 November 2022 + Class time plan - Today: network flows as an abstract graph problem - Wednesday: a bunch of applications of network flows - Friday: follow-up questions and the beginning of some of my favorite algorithms - Monday: questions, more cool algorithms - Wednesday: questions, recap, maybe one more cool algorithm + Network flows - Definitions: flow network, source, sink, capacity flow, residual graph, augmenting path - Max flow algorithm (Ford-Fulkerson) - Questions: does it terminate?; does it maximize the flow? how long does it take? - Definitions: cut, min cut - Theorem: max-flow, min-cut + Algorithm (Ford-Fulkerson) Initialize f to be f(e) = 0 for all e in E Initialize residual graph G_f accordingly while there exists a path P from s to t in the G_f: let "bottleneck" of P be the minimum edge capacity in P push bottleneck's worth of flow onto all edges in P and update f and G_f accordingly