...

/

The Max Flow Problem

The Max Flow Problem

Learn about flow problems in graph networks.

The next lessons discuss algorithms that solve flow problems in weighted graphs. Apart from direct applications in flow networks, they can also be applied to solve various kinds of matching or assignment problems.

Example of a flow network

As an example, let’s consider the problem of transferring a large file on the internet from London to Frankfurt. We want to achieve the maximum possible throughput in doing so. On the way, we may need to pass several intermediate nodes, and each connection we use on the way has a limited data rate.

This situation can be modeled as a weighted graph where the edge weights correspond to the maximum throughput on each connection, for example,. in Megabit per second:

g a London b Amsterdam a->b 5 d Paris a->d 8 c Brussels b->c 4 e Hamburg b->e 3 g Frankfurt c->g 4 d->c 3 f Strassbourg d->f 4 e->g 2 f->g 5 g->t s->a
Capacities in a computer network

Naturally, we’d like to utilize each connection at its full capacity. However, this is not always possible. For example, the outgoing connections from Amsterdam have a total capacity of 7 Mb/s, but the only incoming connection has a capacity of only 5 Mb/s, so the outgoing connections cannot be fully utilized.

The maximum network flow which can be achieved in this network is 10 Mb/s. There are actually several ways to obtain this maximum flow. The following image shows one of them:

g a London b Amsterdam a->b 5/5 d Paris a->d 5/8 c Brussels b->c 3/4 e Hamburg b->e 2/3 g Frankfurt c->g 4/4 d->c 1/3 f Strassbourg d->f 4/4 e->g 2/2 f->g 4/5 g->t s->a
Achieving the maximum throughout of 10 Mb/s

The maximum flow problem

Let’s come up with a formalization of the flow maximization problem. The setting is a directed graph G=(V,E,c)G = (V, E, c), called a flow network, where c:ENc : E \to \mathbb{N} is a weight function. The edge weights are the capacities of the edges, written as c(u,v)c(u, v).

The capacity of an edge is the maximum flow that can be pushed through that single edge. We assume that the capacities are integers, and only an integer amount of flow can be pushed through an edge.

There are also two special nodes in VV ...