Book contents
- Frontmatter
- Contents
- Preface
- Introduction
- Part One Iterative Algorithms and Loop Invariants
- Part Two Recursion
- Part Three Optimization Problems
- 13 Definition of Optimization Problems
- 14 Graph Search Algorithms
- 15 Network Flows and Linear Programming
- 16 Greedy Algorithms
- 17 Recursive Backtracking
- 18 Dynamic Programming Algorithms
- 19 Examples of Dynamic Programs
- 20 Reductions and NP-Completeness
- 21 Randomized Algorithms
- Part Four Appendix
- Part five Exercise Solutions
- Index
15 - Network Flows and Linear Programming
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- Introduction
- Part One Iterative Algorithms and Loop Invariants
- Part Two Recursion
- Part Three Optimization Problems
- 13 Definition of Optimization Problems
- 14 Graph Search Algorithms
- 15 Network Flows and Linear Programming
- 16 Greedy Algorithms
- 17 Recursive Backtracking
- 18 Dynamic Programming Algorithms
- 19 Examples of Dynamic Programs
- 20 Reductions and NP-Completeness
- 21 Randomized Algorithms
- Part Four Appendix
- Part five Exercise Solutions
- Index
Summary
Network flow is a classic computational problem with a surprisingly large number of applications, such as routing trucks and matching happy couples. Think of a given directed graph as a network of pipes starting at a source node s and ending at a sink node t. Through each pipe water can flow in one direction at some rate up to some maximum capacity. The goal is to find the maximum total rate at which water can flow from the source node s to the sink node t. If this were a physical system of pipes, you could determine the answer simply by pushing as much water through as you could. However, achieving this algorithmically is more difficult than you might at first think, because the exponentially many paths from s to t overlap, winding forward and backward in complicated ways.
An Optimization Problem: Network flow is another example of an optimization problem, which involves searching for a best solution from some large set of solutions. The formal specifications are described in Chapter 13.
Network Flow Specification: Given an instance 〈G, s, t〉, the goal is to find a maximum rate of flow through graph G from node s to node t.
Precondition: We are given one of the following instances.
Instances: An instance 〈G, s, t〉 consists of a directed graph G and specific nodes s and t. Each edge 〈u, v〉 is associated with a positive capacity c〈uv〉. For example, see Figure 15.1.a.
Postcondition: The output is a solution with maximum value and the value of that solution.
- Type
- Chapter
- Information
- How to Think About Algorithms , pp. 198 - 224Publisher: Cambridge University PressPrint publication year: 2008