Network Flows
Stay organized with collections
Save and categorize content based on your preferences.
Many problems in computer science can be represented by a graph consisting of
nodes and links between them. Examples are network flow problems, which
involve transporting goods or material across a network, such as a railway
system.
You can represent a network flow by a graph whose nodes are cities and whose
arcs are rail lines between them. (They're called flows because their
properties are similar to those of water flowing through a network of pipes.)
A key constraint in network flows is that each arc has a capacity —
the maximum amount that can be transported across the arc in a fixed period of
time.
The maximum flow problem is to determine the maximum total amount that can
be transported across all arcs in the network, subject to the capacity
constraints.
The first person to study this problem was the Russian mathematician A.N.
Tolstoi, in the 1930s. The following map shows the actual railway network for
which he wanted to find a maximum flow. The map itself comes from "Theodore E.
Harris and Frank S. Ross. Fundamentals of a method for evaluating rail net
capacities. Research Memorandum RM-1573, The RAND Corporation, Santa Monica,
California, October 24, 1955. Declassified May 13, 1999".
OR-Tools provides several solvers for network flow problems in its
graph libraries.
The following sections present examples of network flow problems and show how to
solve them:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-18 UTC."],[],["Computer science utilizes graphs to model problems like network flow, where goods are transported across a network (e.g., railway). Each link (arc) in the network has a capacity, limiting transport volume. The maximum flow problem determines the highest total transport volume across all arcs, respecting these capacity constraints. This problem, first studied by A.N. Tolstoi, can be solved using solvers from the OR-Tools graph libraries, which are useful for problems such as maximum flows, minimum cost flows, and assignment problems.\n"]]