Skip to content

Flow Networks

Summarized notes on Introduction to Algorithms, Chapter 26

  • consider some source that produces material and some sink that consumes it
    • flow represents the the rate at which material moves through a system
    • each edge in system is a conduit for the material
    • each conduit has maximum capacity
    • vertices are conduit junctions and does not collect in these junctions
    • rate of entry = rate of exit → flow conservation
  • Maximum flow problem: compute the greatest rate at which material can be shipped from source without violating capacity constraints

Flow Networks

  • directed graph G=(V,E) where
    • each edge has nonnegative capacity c(u,v)0
    • if E contains edge (u,v) there is no edge (v,u) in reverse direction
    • if (u,v)E then c(u,v)=0
    • edges are labelled as flow/capacity → flow capacity
    • self-loops are not allowed
  • two special vertices: source s and sink t
  • all vertices connected, EV1
  • flow in G is a real-valued function that satisfies
    1. capacity constraint: for all (u,v)V, 0f(u,v)c(u,v)
    2. flow conservation: for all uV{s,t}:
      vVf(v,u)=vVf(u,v)
  • value of flow is defined as \(|f|=vVf(v,u)vVf(u,v)\)
  • maximum flow problem: given G and s and t, find flow f with maximum value

img

Antiparallel edges

  • antiparallel edges violate constraint (u,v)E(v,u)E
  • if antiparallel exist, transform network into an equivalent without antiparallel edges
    • choose one edge and add new vertex v
    • replace (v1,v2) with (v1,v) and (v,v2)
    • set same capacity as original edge

img

Multiple sources and sinks

  • if multiple sources and sinks → convert to network with one source and sink
  • add supersource s:
    • add directed edge (s,si) with capacity c(s,si)= for each i=1,2,...,m
  • add supersink t:
    • add directed edge (ti,t) with capacity c(ti,)= for each i=1,2,...,n

img