Professional Documents
Culture Documents
lecturers :
Gilles Baroin
Catherine Mancel
Introduction
What is Operations Research?
“Operations Research (O.R.), or operational research in the U.K, is a
discipline that deals with the application of advanced analytical methods
to help make better decisions.
The term management science is sometimes used as synonym for
operations research. Employing techniques from other mathematical
sciences, such as mathematical modeling, statistical analysis, and
mathematical optimization, operations research arrives at optimal or near-
optimal solutions to complex decision-making problems.
2
OR – Combinatorial Optimization – IATOM
How can OR help
the Decision Process in Industry
Managers OR specialists
Modeling
Industrial theoretical
Problematics models
Operational level
Solution design
Decision Aid or/and
Results Analysis Optimization tools
3
OR – Combinatorial Optimization – IATOM
Key points in the OR approach
4
OR – Combinatorial Optimization – IATOM
what does modeling mean?
5
OR – Combinatorial Optimization – IATOM
what is an algorithm?
7
OR – Combinatorial Optimization – IATOM
Outline
9
OR – Combinatorial Optimization – IATOM
1. Linear Programming
10
OR – Combinatorial Optimization – IATOM
Optimization problems and
mathematical models
11
OR – Combinatorial Optimization – IATOM
Linear optimization problems
12
OR – Combinatorial Optimization – IATOM
1.1 General form of a linear program
s.t.
(constraints)
13
OR – Combinatorial Optimization – IATOM
Matrix representation
- parameters-
m x n matrix of constraints :
s.t.
n decision variables :
s.t.
15
OR – Combinatorial Optimization – IATOM
Vocabulary
The set of all feasible solutions is called feasible set, or feasible domain,
or feasible area
16
OR – Combinatorial Optimization – IATOM
Canonical form of a linear program
Maximization
Non-negative variables
Constraints : " "
s.t.
17
OR – Combinatorial Optimization – IATOM
An example
– An air freight carrier has a freight capacity
of 900 kg and 12 m3 left.
Understanding …
Modeling
– Which are the decision variables?
– What is the optimization criterion?
– Which are the constraints to be satisfied?
Solving
Analyzing results
19
OR – Combinatorial Optimization – IATOM
Modeling
– 2 decision variables :
Let x = the quantity of product 1 we decide to load
Let y = the quantity of product 2 we decide to load
– two constraints
Maximum weight has to be respected (100x+300y 900)
Maximum volume has to be respected (2x+3y 12 )
– one objective function (maximization)
Maximize the profit (z = x+2y)
20
OR – Combinatorial Optimization – IATOM
Model
Max z = x+2y
s.t. x+3y 9 The objective fonction and the
constraints are linear :
2x+3y 12
x, y 0 this is a Linear Program (LP)
x and y are the decision variables (or unknowns) of the LP ; the coefficients of x and y in
the objective function and in the constraints are the parameters of the LP. Here
we have a LP in its canonical form, i.e. a maximization problem, with n+m inequalities,
where n is the number of variables (n=2) and m is the number of constraints (m=2).
When constraints are given as equalities instead of inequalities, the LP is in its standard
form.
21
OR – Combinatorial Optimization – IATOM
Remark
Production Problem :
– A factory produces two kinds of products, using two types of
resources (raw materials). The manufacturing of these products
respectively yields a profit of 1 and 2 euros by unit. The manufacturing
of one unit of each product needs respectively 1 and 3 units of
resource 1, and 2 and 3 units of resource 2.
There is a stock of 9 units of resource 1 and 12 units of resource 2.
22
OR – Combinatorial Optimization – IATOM
1.2 Solving a LP
23
OR – Combinatorial Optimization – IATOM
1.2.1 Graphical resolution
S3
S0 z=4
10 x+3y=9
z=0 2x+3y=12 24
OR – Combinatorial Optimization – IATOM
Graphical solution
Solution :
x+ 3y=9 x*=3
2x+3y=12 y*=2 and z*=7
S1
S2 The optimal solution is
always at a cornerpoint !
S3
S0 z=4
10 x+3y=9
z=0 2x+3y=12 25
OR – Combinatorial Optimization – IATOM
1.2.2 algebraic solution : the Simplex
Method
In case n>2 (more than 2 variables), it is impossible to give
a graphical representation of the problem
26
OR – Combinatorial Optimization – IATOM
Geometry of a LP
27
OR – Combinatorial Optimization – IATOM
1.2.2.1 Algebraic solution of the 2-
variable example
Standard form of the LP :
We need a system with linear equations instead of
inequalities :
add one slack variable per constraint :
S3
S0
31
OR – Combinatorial Optimization – IATOM
Let’s choose to increase x2
S3
S0
32
OR – Combinatorial Optimization – IATOM
New solution
a = 9- x1- 3x2 0 x2 3
b = 12- 2x1- 3x2 0 x2 4
x1 = 0, x2 = 3 , a= 0, b= 3 et z= 6
It’s better !
It’s a new cornerpoint, or new basic solution (S1, basis
(x2,b))
Can we still increase z?
s.t. 1 to m
1 to n
s.t.
40
OR – Combinatorial Optimization – IATOM
First basic solution
We obtain a dictionary that defines values of z and of variables xn+1
to xn+m in terms of variables x1 to xn :
1 to m
Set x1= …= xn =0 and compute the values of the other variables
compute the basic solution associated with this dictionary
41
OR – Combinatorial Optimization – IATOM
Dictionary
At each iteration :
Look for a cj>0 in the current dictionary :
If such value exists :
If there are several, choose maxj (cj)
Decide to increase as much as possible the value of xj
Constraint : xj bi/aij , for each i=1 to m
Deduce the other values
A new basic solution is obtained, that improves the value of z
Get the corresponding new dictionary (dictionary updating)
Else (cj0 j) : the current solution is the optimal one
43
OR – Combinatorial Optimization – IATOM
Details of the Dictionary Updating
New dictionary features:
– xj becomes a variable of the left hand-side member of the dictionary
(non-zero variable)
– One specific variable, xk, previously in the left hand-side member,
becomes zero and is moved in the right hand-side member
" xj enters in the basis, xk is removed from the basis"
To get the new dictionary :
– xj is expressed in terms of xk with help of the constraint that limits the
value of xj in the new current solution
– xj is replaced by its expression in the other equations of the
dictionary
44
OR – Combinatorial Optimization – IATOM
Exercise :
Solve this 3-variables example
Max z = x1+2x2+3x3
S.t. x1+ 3x2+ 4x3 9
2x1+ 3x2+ 4x3 12
x1, x2, x3 0
45
OR – Combinatorial Optimization – IATOM
1.3 Duality
46
OR – Combinatorial Optimization – IATOM
Primal problem with equality
constraints
47
OR – Combinatorial Optimization – IATOM
1.3.1 Duality rules
Primal Dual
max min
constraint i variable i 0
constraint i variable i 0
constraint i = free variable i
variable j 0 constraint j
variable j 0 constraint j
free variable j constraint j =
Dual Primal
48
OR – Combinatorial Optimization – IATOM
1.3.2 Duality theorems
49
OR – Combinatorial Optimization – IATOM
Strong duality theorem
50
OR – Combinatorial Optimization – IATOM
Complementary slackness theorem
Let the pair of dual problems :
Primal (P) Dual(D)
max z = cx min w = b
st. Axb st. 0
x0 A c
Assume (P) has an optimal solution x* and problem (D) has an optimal
solution *
– If xj*>0 , then the jth constraint in (D) is binding (Aj=cj)
– If the ith constraint in (P) is not binding (Aix*<bi), then i*=0.
– If i*>0 , then the ith constraint in (P) is binding.
– If the jth constraint in (D) is not binding (*Aj>cj), then xj*=0.
51
OR – Combinatorial Optimization – IATOM
1.3.3 Two-Phase Simplex method
53
OR – Combinatorial Optimization – IATOM
2. Integer Linear Programming
54
OR – Combinatorial Optimization – IATOM
2.1 Example
Aircraft Load
– An air freight carrier has a freight capacity of 900 kg and 12 m3 left.
– 2 kinds of products (subdivisible at will) can be loaded in the aircraft
respectively defined by a unit profit of 1 and 2 value units, by a unit
weight of 100 and 300 kg et by a unit volume of 2 and 3 m3.
– How shall we load the aircraft so that to maximize the total profit?
Model :
Max z = x+2y
s.t. x+3y 9
2x+3y 12
x, y N
x+3y=9
2x+3y=12
12 55
OR – Combinatorial Optimization – IATOM
Another example :
Assignment Problem
– At a given time T, an airline has 4 aircraft at an airport A and 3 flights to achieve
starting from A in a small time window [T, T+d](so that one aircraft is not able to
achieve two flights).
– The assignment of each aircraft a to a flight f leads to an operational cost caf for the
airline.
– How to assign aircraft to flights in order to minimize the total operational cost?
Model ?
56
OR – Combinatorial Optimization – IATOM
Assignment Problem
– At a given time T, an airline has 4 aircraft at an airport A and 3 flights to achieve starting from A in
a small time window [T, T+d](so that one aircraft is not able to achieve two flights).
– The assignment of each aircraft a to a flight f leads to an operational cost caf for the airline.
– How to assign aircraft to flights so that to minimize the total operational cost?
Model :
Variables :
let xaf =1if aircraft a is assigned to flight f and 0 otherwise.
Constraints :
each flight has to be achieved exactly once
each aircraft has to be assigned at most to one flight
Objective function :
minimize the cost of assignment
57
OR – Combinatorial Optimization – IATOM
Assignment Problem
– Integer Linear Model :
Min z = a=1to4f=1to3cafxaf
s.t. a=1to4 xaf = 1, for each f =1 to 3
f=1to3 xaf 1, for each a =1 to 4
xaf{0,1} for each a =1 to 4, for each f=1 to 3
58
OR – Combinatorial Optimization – IATOM
2.2 How to solve an Integer Problem?
Linear programming methods don't work because the set of
solutions is not a convex polyedra anymore but only the set
of the integer points in this convex polyedra
60
OR – Combinatorial Optimization – IATOM
Is it a good idea to choose rounding
values as solution of an ILP?
Let consider the following integer
linear model :
Max z = x+y
s.t. x- 2y 0
x+4y 16
x, y N
61
OR – Combinatorial Optimization – IATOM
2.3 Linear Relaxation
62
OR – Combinatorial Optimization – IATOM
2.4 Upper bound, lower bound
64
OR – Combinatorial Optimization – IATOM
Branch and Bound method
Let consider a node of the search tree. (P) is the corresponding integer
problem. (L) is the linear relaxation of (P). Let xL* the optimal solution of
(L). If xLi* is not integer then we can state that (P) is equivalent to
((P1)OR(P2))
with (P1)=((P) plus the additional constraint xi xLi*)
and (P2)=((P) plus the additional constraint xi xLi*+1)
Then at this node, the search space (set of solutions) can be separated
into two, each one corresponding to a branch of the search tree starting
from this node (one for (P1) and one for (P2))
65
OR – Combinatorial Optimization – IATOM
Example (1)
(P) :
Max z = x+2y
st 2x+y
-x+2y
x,y N
66
OR – Combinatorial Optimization – IATOM
Example (1)
P zP* 9 )
x2 x
P1 P2
no integer integer solution:
solution: x=3 ; y=2 ; z= 7
xL*= 2; zP* 7
yL*= 3.5; (lower bound)
zL*= 9
67
OR – Combinatorial Optimization – IATOM
Example (1)
P zP*
9)
P1 P2
X
y y
P3 P4
integer solution: no solution
x=2 ; y=3 ; z= 8 X
zP* 8
new lower bound
End of search
zP*=8 ; xP*= 2 ; yP*= 3
68
OR – Combinatorial Optimization – IATOM
Example (2)
aircraft load problem with 80kg left instead of 90kg
Max z = x+2y
s.t. x+3y 8
2x+3y 12
x, y N
69
OR – Combinatorial Optimization – IATOM
Example (2)
aircraft load problem with 80kg left instead of 90kg
70
OR – Combinatorial Optimization – IATOM
Example (2)
aircraft load problem with 80kg left instead of 90kg
71
OR – Combinatorial Optimization – IATOM
2.6 Conclusion
72
OR – Combinatorial Optimization – IATOM
3- Graph theory
A
A
D
D B C B
C
75
OR – Combinatorial Optimization – IATOM
Examples
76
OR – Combinatorial Optimization – IATOM
Definitions (2)
Let G=(X, U), where U= A or E. G is either an oriented or non-oriented
graph
Weighted graph
– A weight (or cost, or value) can be associated with each edge (or arc) of a
graph G.
– G=(X,U,w) is a weighted graph, where w : U R is a weight function.
Sub-graph, partial graph
– Let G'=(X',U') with X'X and U'={u =(x,y)U with x,y X'}. G' is a subgraph
of G=(X,U)
– Let G'=(X,U') with U' U. G' is a partial graph of G =(X,U)
Adjacency
– Two nodes (x,y) are adjacent if there is an arc (or edge) u=(x,y) in U.
77
OR – Combinatorial Optimization – IATOM
Definitions (3)
Let G=(X, A) an oriented graph
Successors and predecessors
– with each node xX are associated the set (x) of its successors and the
set -1(x) of its predecessors. Let (x,y) A, x is a predecessor of y and y is
a successor of x
Degree of a node
– out degree of a node x : d+(x) = number of arcs starting from x
– in degree of a node x : d-(x) = number of arcs ending at x
– degree of a node x : d(x) = d+(x) + d-(x)
– Note that In non-oriented graph, d(x)= number of nodes adjacent to x
78
OR – Combinatorial Optimization – IATOM
Definitions (4)
Path
– A path is a graph P=(X,U) where X={x0, x1,…xn} and
U={(x0,x1)(x1,x2)…(xn-1,xn)}.
– P is a path from x0 to xn if U is a set of arcs (P is oriented) ;P is a path
between x0 and xn if U is a set of edges (P is non-oriented) in that case, P is
also called a chain ;
– The weight (or length) of path P is the sum of the weights associated with the
arcs of A.
Cycle
– A cycle is a closed path (where x0= xn)
– An Euler cycle (or tour) of a graph is a cycle that covers each edge of the
graph exactly once
– An Hamiltonian cycle of a graph is a cycle that covers each node of the
graph exactly once
79
OR – Combinatorial Optimization – IATOM
Definitions (5)
Connectivity
– In a non-oriented graph G two nodes x and y are connected if a chain exists
between x and y
– A non-oriented graph is connected if each pair of nodes are connected
– In an oriented graph G two nodes x and y are strongly connected if a path
exists from x to y AND from y to x
– An oriented graph is strongly connected if each pair of nodes are strongly
connected
– A connected component of a graph G is a (strongly) connected subgraph
of G.
80
OR – Combinatorial Optimization – IATOM
Definitions (6)
Tree
– An acyclic graph (graph containing no cycle) is called a forest. A connected
forest is called a tree
– Let G be a graph with m nodes. The following statements are equivalent
G is a tree
Any two nodes of G are linked by a unique path or chain
G contains m-1 edges and is connected
G contains m-1 edges and is acyclic
G is connected and acyclic
81
OR – Combinatorial Optimization – IATOM
Graph problems
82
OR – Combinatorial Optimization – IATOM
3.2- Minimum-weight spanning tree
problem
Example : minimizing the connexion cost in a network (road
network, data network, water network …)
Considering a weighted graph G the problem consists in
searching a partial graph of G that connects each pair of
nodes for a minimum weight
2 algorithms :
– Prim (1957)
– Kruskal (1956)
83
OR – Combinatorial Optimization – IATOM
Example
Let consider a campus to be provided with hot water from a
building (H) to 5 others (A, B, C, D, E). Suppose you have to
design the supply network in order to minimize the construction
cost. Let assume that the construction cost of a pipe link between
each pair of building is known.
The problem can be modelled by the following graph, where each
node represents a building, each weighted edge (i,j) represents the
possibility to build a pipe link between the buildings i and j, with the
associated cost cij. The problem is then to find a minimum weight
spanning tree in this graph. B
1
A 1 2
3 3
1
2 3
H C
3
2
E 1 2
2 D 84
OR – Combinatorial Optimization – IATOM
Prim algorithm
Idea : starting from a tree reduced to one node. At each step the tree
grows by adding a connection to the "closest" node in terms of weight.
Let G=(X,E,w) a weighted graph
– Let T={x} with xX (choice of x is free), ET= ,
86
OR – Combinatorial Optimization – IATOM
3-3 Optimal path problems
Shortest (or minimum-weight) path problems. Or longest path problems
Lots of applications. Each time one have to carry something from one
point to another in a network, so as to minimize a cost, a distance, a
duration.
Lots of sub-problems of great combinatorial problems can also be
expressed as optimal path problems. Specially in scheduling
problems.
3.3.1 Shortest Path Problem (next slide)
3.3.2 Project Scheduling Problem (slide 94)
87
OR – Combinatorial Optimization – IATOM
3.3.1 The Shortest Path Problem
Three kinds of shortest path problems :
– Pb A : Given two nodes x and y, find a shortest path from x to y
(road itinerary for example)
– Pb B: Given one node x, find a shortest path from x to each other
node (choice of a destination for example)
– Pb C : Find a shortest path between each pair of nodes
(computation of a distance table)
88
OR – Combinatorial Optimization – IATOM
Algorithms to solve shortest path
problems
89
OR – Combinatorial Optimization – IATOM
Dijkstra's Algorithm
Applicable in the case where all arc weights are nonnegative. Thus if
p is a path contained in a path p' the weight of p can't be greater than
the weight of p'.
Dijkstra's algorithm is based on the following fundamental property of
shortest paths : suppose k is an intermediate node on a shortest 1-i path
pi, then the 1-k subpath pk of pi is a shortest 1-k path.
pi
1 2 3 pk k i
90
OR – Combinatorial Optimization – IATOM
Dijkstra's Algorithm
Let G=(X,A,w) ,X = {x0, … ,xN}. Dijkstra's algorithm finds a shortest path from x0
to each node xi X
Algorithm :
– Initialization
vector V =[0, … ,min (w0i, ),…, min (w0N, )] (weight of paths) ;
set D = {x0} (“labeled” nodes);
vector P =[0, … ,0] (predecessors in the shortest paths)
– While |D|< N+1
Select xj such that Vj= Minxi X\D (Vi)} (label of xj is set to Vj, the shortest past from
x0 to xj is found)
D=D U {xj}
For each xk (xj)\D if Vj+ wjk< Vk then Vk= Vj+ wjk ; Pk= xj
At each step, Dijkstra's algorithm selects the node xj with the minimum label and
extends the path x0-xj to each successor xk of xj if this new path improve the
current known path from x0 to xk.
91
OR – Combinatorial Optimization – IATOM
Bellman's Algorithm
Applicable in the general case where arc weights can be negative. Thus it can
help to detect negative-weight cycle in a graph.
Based on the fact that a shortest path between two nodes in a graph of N+1
nodes shouldn't contain more than N arcs. If there is a x0-xi path containing
more than N arcs with a weight less than the shortest x0-xi path containing at
most N arcs, then the graph contains a negative-weight cycle.
The idea is to start from a solution and iteratively improve the paths from x0 to
other nodes, decreasing at least one length at each iteration.
If you can still decrease some path length after N iterations, then the graph
contains a negative-weight cycle (at least one shortest path should contain N+1
arcs which is contradictory).
92
OR – Combinatorial Optimization – IATOM
Bellman's Algorithm
Let G=(X,A,w) , x0 X = {x0, … ,xN} Bellman's algorithm finds a shortest path from x0 to
each node xi X
Algorithm
– Initialization
k=0, vector V =[0, … , ] (weight of paths) ; vector P =[0, … ,0] (predecessors)
– Repeat
No_improving = true
For each xj X\ x0
– For each xi -1(xj)
if Vj> Vi + wi j then
94
OR – Combinatorial Optimization – IATOM
Example
duration 7 4 8 2 1 1 5 1
Previous none 1 1 2,3 2,3 2,3 5 4,6,7
tasks
4
2 6 1
7 4
0 8 2 1
s 1 3 8 4 8 e
7 4
8
5
1
5 7
95
OR – Combinatorial Optimization – IATOM
Minimal duration/ longest path
s and e state as fictive tasks for the start and the end of the project.
The global problem consists in searching a start time for each task of
the project so as to minimize the total duration.
A sub-problem consists in searching the minimal duration of the
project.
Each path p from s to e in the graph states for a sequence of constraints
that have to be satisfied. Its weight wp is a duration (a sum of durations)
which means that : te ts+wp wp is a lower bound for the minimal
project duration
This means that the minimal duration of the project is given by the
longest path in the associated AON graph.
96
OR – Combinatorial Optimization – IATOM
Level decomposition of an AON graph
Graph without cycle level decomposition
– A graph without cycle can be decomposed into k levels Li (i=1 to k) with :
each Li is a set of no-adjacents nodes (Li is stable)
for each x Li :
(x) Li+1U …ULk
-1(x) L1U…U Li-1
A level is a set of tasks that can be processed in the same time
L1 L2 L3 L4 L5 L6
4
2 6 1
7 4
0 8 8 2 1
s 1 7
3 4 8 e
8 4
1 5
5 7
97
OR – Combinatorial Optimization – IATOM
Dijkstra's extension for the longest
path problem in a scheduling problem
Rank nodes according to the level decomposition
– Nodes of a same level are free ranked, te is allways ranked at last
Let y be the first node ty=0 , Pred (y) = s
For each successive node x
– tx = max z -1(x)(tz+wzx )
– Pred (x) = z such that tx= tz+wzx
te gives the minimal total project duration
In the example : t1= 0 Pred(1)=s; t2=7 Pred(2)=1; t3=7 Pred(3)=1; t6=15
Pred(6)=3; t4=15 Pred(4)=3; t5=15 Pred(5)=3; t7=16 Pred(7)=5; t8=21
Pred(8)=7; te=22 Pred(e)=8;
L1 L2 L3 L4 L5 L6
Critical path : 2 4
6 1
7 4
s, 1, 3, 5, 7, 8, e s 0 1 7 3 8 8 4 2 8 1
e
4
critical tasks : 1,3,5,7,8 8
1 5
5 7
98
OR – Combinatorial Optimization – IATOM
Earliest start time/ lastest start time
Search of the longest path gives also for each tasks its earliest start time ti
In the example : t1= 0; t2=7; t3=7; t4=15; t5=15; t6=15; t7=16; t8=21; te=22;
From the minimal project duration one can easily find the latest start time t'i of
each task i :
– Rank the tasks in descending order of level decomposition
– For each successive node x (from e to s)
If x=e : t'e= te else tx = min z (x)(tz - wxz )
Succ (x) = z such that tx= tz-wxz
99
OR – Combinatorial Optimization – IATOM
Gantt diagram
Schedule graph
4
6 Latest schedule
2
4
2 6 Earliest schedule
1 3 5 7 8
0 7 11 15 16 19 20 te=22
100
OR – Combinatorial Optimization – IATOM
3.4 Maximum network flow problem
101
OR – Combinatorial Optimization – IATOM
Examples
102
OR – Combinatorial Optimization – IATOM
Definitions
(G,c,s,t) is a network iff:
– G is an oriented graph
– Each arc (i,j) has a capacity c(i,j)
– s is the source node with in degree (d-(s)) null
– t is the sink node with out degree (d+(s)) null
A feasible flow (across a network) is a function f : AR+ that
satisfies
– the balance constraint at each node : "all that goes in must go out"
(for each v N, v s,t, u -1(v) f(u,v) = u (v) f(v,u))
– and the capacity on each arc
(for each u,vN f(u,v) c(u,v))
103
OR – Combinatorial Optimization – IATOM
Example
Max f(t,s) ? Example of application :
The maximum flow +
problem is to find a 12 An oil company needs to ship oil
feasible flow that A C from a refinery to a storage facility
maximizes the flow 16 20 using the pipelines of its underlying
on arc (t,s) with no s 4 10 9 7 t distribution network. In this
exogenous supplies problem context, the refinery
13 4
or demands. 14 corresponds to a particular node s in
B D
the distribution network and the
storage facility corresponds to
another node t. The capacity of each
arc is the maximum amount of oil
Flow in v Flow out per unit time that can flow along it.
The value of a maximum s-t flow
determines the maximum flow rate
from the source node s to the sink
node t.
104
OR – Combinatorial Optimization – IATOM
Definitions
If a fictive arc (t,s) is added to the network, the value of a
flow across the network is the value of the flow on arc (t,s)
An arc is saturated if the flow value on this arc is equal to
its capacity (A maximum flow contains at least one saturated arc)
Example : flow of value 19
19
12
A 12 C
11 15
16 20
1 0
s 4 10 9 7 t
4 7
8
13 4
14 4
B D
11
105
OR – Combinatorial Optimization – IATOM
Min cut problem
A closely related problem to the MFP is the Minimum cut problem :
find a set of arcs with the smallest total capacity whose removal
separates node s and node t.
That is, there is no path from s to t after its removal
Max-Flow Min-cut theorem :
12
The maximum value of the flow from a
A C source node s to a sink node t in a
16 20 capacitated network equals the
s 4 10 9 7 t
minimum capacity among all s-t cuts
13 4
B
14
D Solving the MCP gives a solution to
MFP ! But solving the MCP is difficult …
106
OR – Combinatorial Optimization – IATOM
Ford-Fulkerson's algorithm
Algorithm to solve the MFP
Based on iterative search of an Augmenting path
Path that can support a feasible flow that will increase the value of the global
flow.
Definition : let G=(X,A) a directed graph and (G,c,s,t) an associated network with
a flow f.
– If (i,j) A, with f(i,j)< c(i,j), arc (i,j) is called a forward arc and is associated
with the residual capacity c(i,j)-f(i,j)
– If (i,j) A, with f(i,j)> 0 , arc (j,i) is called a reverse arc and is associated with
the residual capacity f(i,j)
The residual network is the network containing the forward arcs and the reverse
arcs of ((G,c,s,t),f)
An augmenting path for the flow f in (G,c,s,t), is a path from s to t in the residual
network.
107
OR – Combinatorial Optimization – IATOM
Idea of FF's algorithm
Problem network
19
Residual network
12 12
A 12 C A C
11 15
11 15
16 20 10 1 5
1 0 5 5
s 4 10 9 7 t s 7 t
4 7 3 4
8 5 4
13 4 8
14 4
B D B 3 D
11 11
23
12
12 A C
A 12 C 11 15
11 19 10 1 5
16 20 5 5
0 1 s 7 t
s 10 4 9 7 t 3 4
0 7 5 4
12 8
13 4
14 4 B 3 D
B D 11
11
12 12
A 12 C A C
11 19
11 19
16 20 10 1 9
0 1 5 1
s 10 4 9 7 t s 7 t
0 7 3
12 1 4
13 4 12
14 4
B D B 3 D
11 11
12
A C
11 19
10 1 9
5 1
s 7 t
3
1 4
STOP : Max f = 23 12
B 3 D
11
No path from s to t
109
OR – Combinatorial Optimization – IATOM
Algorithm
Each node i will be labeled with (p(i), ) where p(i) is the node from which i receives flow and is the
amount of flow sent from p(i) to i
Step 1 (initialization)
– f =0 (or any feasible flow)
– s is labeled (s,). All nodes are "unscanned", and all nodes except s are unlabeled.
– Let i= s
Step 2 (scan node i)
– For all j such that (i,j)A, f(i,j) < c(i,j) and j is unlabeled, (i,j) is a forward arc
label j (i, min (, c(i,j)-f(i,j)))
– For all j such that (j,i)A, f(j,i) >0, and j is unlabeled, (i,j) is a reverse arc
label j (i, min (, f(j,i)))
Step 3 : if t is labeled, go to step 4. Else, choose a labeled and unscanned node i and go to step 2 .
If none exists, the current flow is maximum
Step 4 : t is labeled (p(t), ) . An augmenting path has been found.
– Use the first element of each label to trace back the path back to s
– Increase the flow by on all forward arcs of the path and decrease the flow by on all reverse
arcs.
– Erase all labels and return to step 1
110
OR – Combinatorial Optimization – IATOM
3.5 Conclusion
Graph theory offers models and exact methods to solve lots
of optimization problems.