Professional Documents
Culture Documents
O-R. p24. Janvier 2024
O-R. p24. Janvier 2024
··················
Pathways : CS
··················
Second year / Semester IV
OPERATIONAL RESEARCH
I GRAPH THEORIES 2
2 SCHEDULING PROBLEMS 34
2.1 The potential-task method or MPM . . . . . . . . . . . . . . . . . . . . . . 35
2.1.1 Construction of the graph . . . . . . . . . . . . . . . . . . . . . . . 35
2.1.2 Exploitation of the graph . . . . . . . . . . . . . . . . . . . . . . . . 36
2.2 The method: Program Evaluation and Review Technic or PERT . . . . . . 37
2.2.1 Construction of the graph . . . . . . . . . . . . . . . . . . . . . . . 37
2.3 GANTT diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3 TRANSPORT PROBLEMS 40
2
3.1 Definition of a transport network . . . . . . . . . . . . . . . . . . . . . . . 40
3.2 Definition of a flow in a transport network . . . . . . . . . . . . . . . . . . 41
3.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.2.2 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.3 Maximum flow problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.1 Saturation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.2 Achievable float . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.3 Maximum float . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.4 Maximum flow at minimum cost . . . . . . . . . . . . . . . . . . . . . . . . 43
3.5 Finding a maximum flow: Ford-Fulkerson algorithm . . . . . . . . . . . . . 44
3.5.1 Improving chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5.2 Ford-Fulkerson algorithm . . . . . . . . . . . . . . . . . . . . . . . . 44
II LINEAR PROGRAMMING 46
5 SIMPLEX METHOD 61
5.1 Basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.1.1 Theoretical sketch of the simplex method . . . . . . . . . . . . . . . 62
5.2 Concepts and simplex algorithm . . . . . . . . . . . . . . . . . . . . . . . . 65
3
5.3 Use of artificial variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.3.1 Constraints of the problem LP a . . . . . . . . . . . . . . . . . . . . 67
5.3.2 Economic function . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.4 Duality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.4.1 Formulation of the dual problem from the primal . . . . . . . . . . 69
5.4.2 Theorem of duality . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Bibliographie 72
i
Introduction
Operations Research (OR) or (the science of decision making) is the discipline of sci-
entific methods that can be used to develop better decisions. It is used to rationalize,
simulate, plan and optimize the architecture and operation of production or organiza-
tional systems.
OR is a recent discipline (around 60-70 years old) which straddles the border between
Computer Science, Economics and Applied Mathematics.
Sub-disciplines of OR
* Mathematical programming
* Combinatorial optimization
* Stochastic Optimization (Probability)
* Graph theory.
*****************************************************
Operations research is a branch of applied mathematics. It is a tool to assist and ratio-
nalise decisions. It is a set of methods and tools for analysing and synthesising organisa-
tional phenomena that can be used to develop better decisions. It is a discipline at the
crossroads between computer science, applied mathematics and business economics. It
aims to improve the operations of companies and public bodies by applying a scientific
approach. With the birth of computer science, O.R experienced a meteoric rise with the
expansion of calculation possibilities and the implementation of algorithms. O.R con-
tributes to the improvement of the functioning of human companies by offering scientific
methods for planning, managing and optimising projects. The fields of application in
companies are production (allocation of limited resources to achieve a goal, scheduling)
(allocation of limited resources to achieve an objective, scheduling), inventory manage-
ment, logistics (optimal location of warehouses, minimisation of global transport costs,
...), combinatorial problems (definition of the most profitable investments, scheduling (def-
inition of the most profitable investments, scheduling, queues, traffic peaks, ..., sales and
supply policy) etc. This course is an introduction to operations research and is divided
into two parts:
◦ Graph theory
◦ Linear programming.
1
Part I
GRAPH THEORIES
2
Graph theory is used to model (mathematically translate) many concrete situations
involving interacting objects. It is used to model problems in several disciplines (chem-
istry, biology, economics, social sciences, cartography, linguistics, artificial intelligence,
etc.). Graphs facilitate the management of objects and their interactions, allowing the
system manager (Objects interactions) to make decisions. From this point of view, graph
theory has developed resolution methods or algorithms to answer the questions asked by
the manager.
3
Chapter 1
Remark 1.1.2 A graph can also be defined as a non-empty set of vertices and edges
joining two vertices. It is used to describe a set of objects and their relationships, i.e.
the links between objects. The objects are called nodes, or vertices of the graph. A link
between two objects is called an edge.
Example 1.1.3 Four cities A, B, C and D connected by a two-way rail network is such
that A is connected to B and C; C is connected to B and D. The rail network can be
represented by a graph as follows:
4
G = (X, E) X = {A, B, C, D} and E = {(A, B), (A, C), (B, C), (C, D)}.
Example 1.1.4 A company that produces six different kinds of chemicals (labelled P1,
P2, P3, P4, P5, P6) needs to transport them by train. These products are in small
quantities but cannot all be placed in the same wagon for safety reasons These products
are small in quantity but cannot all be placed in the same wagon for safety reasons (
contact between some of these products can cause explosive reactions). More precisely: P1
cannot be transported with P2, P3, or P4. P2 cannot be transported with P3 or P5. P3
cannot be transported with P4. P5 cannot be transported with P6.
Let’s make a graph taking as vertices the products and edges reflecting the incompatibility
between products.
} Adjacent summits
Two vertices x and y are adjacent if and only if there exists the edge {x, y} in E. The
vertices x and y are then said to be neighbours.
} Incidental edge
An edge is incident to a vertex x, if x is one of its ends.
} Degree of a vertex
The degree of a vertex x of G is the number of edges incident to x. It is denoted d(x).
5
For a simple graph the degree of x is also the number of vertices adjacent to x. A graph
is said to be regular of degree k when all vertices are of degree k.
6
The arcs constitute a subset of the Cartesian product XX. For an arc e(x, y), x is called
the origin or initial end and y the final end. The arc e is said to be outgoing in x and
incident in y. y is said to be successor of x and x is said to be predecessor of y. The
vertices x and y will be said to be adjacent in G.
Remarck: an arc having its ends confused is said loop.
The arc e = (x; y) is represented as follows:
7
Remark 1.2.2 • A simple graph is a graph where any two vertices are connected by at
most one arc.
• The number of arcs having the vertex x for initial extremity is the degree exiting from x
and noted d+ (x). The number of arcs having the vertex x as their final end is the incoming
degree of x and is denoted by d− (x). The degree d(x) of x is then: d(x) = d+ (x) + d− (x).
• To a directed graph, we associate a non-oriented graph by "dropping the orientation".
Similarly, to an undirected graph a directed graph is associated, either by introducing for
each edge the two arcs that correspond to it, or by choosing only one of the two arcs.
A graph G is said to be valuated if each edge or arc is associated with a real number.
These real numbers associated with the arcs give information about them. A valuated
graph is denoted G(X; E; ζ) where is a function from E to R which associates a real
number to each edge or arc.
8
1.4 Basic concepts
A directed path with origin x and end y in a directed graph is a sequence (x, ..., y) of
vertices such that if v follows u in this sequence, (u, v) is an arc.
A path is thus a sequence of vertices [x0 , x1 , · · · , xp ] such that the arcs (x0 , x1 ), (x1 , x2 ),
· · · , (xp−1 , xp ) belong to the graph. The vertex x0 is called the initial end of the path
and the vertex xp the terminal end and the path is of length p.
9
Eulerian path A path is said to be Eulerian (respectively Hamiltonian) if it passes
once and only once through each arc (respectively vertex) of the graph.
Descending vertex, ascending vertex A vertex j is a descendant of a vertex i if
there is a path from i to j or if i = j; we then say that i is an ascendant of j.
Source and sink vertices A source s is a vertex ascending from all other vertices, a
sink p, a vertex descending from all other other vertices.
Chains A chain is a sequence of arcs u1 , u2 , u3 · · · , up such that one end of the arc ui
(2 ≤ i ≤ p − 1) is common with the arc ui+1 , while the other end is common with the
arc ui−1 . The length of a chain is its number of arcs.
10
Exercise: In the graph above, name the strings
A chain can be "seen" as a sequence of vertices such that two consecutive vertices are
linked by an arc, Some arcs can be traversed in the direction of the chain (+ direction),
the other arcs in the opposite direction (- direction).
Cycles
A cycle is a chain whose initial end merges with the terminal end.
Exercise: In the figure above, determine the cycles.
Length of a chain : The length of a chain is the number of edges that make it up.
Distance between vertices
The distance between two vertices x and y is the shortest chain joining these two
vertices.
Diameter of a graph: The diameter of a graph is the maximum of the distances
between its vertices.
Value of a string : It is the sum of the values of the edges which compose it Related
graphs.
The notion of connectedness is linked to the existence of paths in a graph: from a
vertex, is there a path to reach any other vertex?
11
Definition 1.4.1 A graph is said to be connected if for any pair of vertices {x; y} there
exists a chain or a path of first term x and last term y. A connected graph with no cycle
and no loop is called a tree.
A colouring of a graph consists in the attribution of colours to the vertices, so that two
adjacent vertices never have the same colour.
Remark 1.4.2 the existence of this number is assured because the graph is finite. The
Chromatic number of a graph is less than or equal to r + 1, where r is the largest degree
of its vertices.
12
• The set of predecessors of xi is noted Γ −1 (xi ).
Exercise: Dans the graph below give the predecessors of 3 and the successors of 4.
13
summits successors predecessors
1 3;5 2;4
2 1; 3; 5 5
3 4 1; 2; 6
4 1 3; 6
5 2 1; 2; 6
6 3; 4; 5 -
Adjacency matrix
14
• A vertex of level zero is a vertex A with no predecessors.
• In a directed graph without circuit for which we have chosen an origin vertex A of level
0.
Consider a vertex x: the level of vertex x is the maximum number of arcs of all the
paths connecting A to x. A vertex x is of level k + 1, if it has at least one predecessor of
k and all its predecessors are of levels less than or equal to k.
To determine the levels in a graph, we can proceed as follows:
Step1: Build the precedence dictionary.
Step2: 1. Determine all the vertices of level 0 i.e. N0 then we cross out all the vertices
of level 0 in the precedence table.
2. The vertices of level k(k > 0) are those not yet crossed out and having only crossed
out predecessors not crossed out at stage k.
Let the following graph be :
Summits Predecessors
A F
B C; D; F
C A; D; E
D A
E F
F -
15
• F is its predecessors, it is level 0. It is crossed out in the whole precedence diagram.
• A and E are unbarred and have their predecessors barred, they are of level 1. They
are crossed out the whole precedence diagram.
• D is unbarred and has its predecessors barred, it is level 2. It is crossed out on the
precedence diagram.
• E is undecked and has its predecessors crossed out, it is level 3. It is crossed out on
the entire precedence diagram.
• B is unbroken and has its predecessors broken, it is level 4. Cross out the entire
precedence diagram.
We obtain the new diagram organized by level:
16
Let’s search all the paths from E.
E marked its successors are A.
A marked its successors are C, B and E (E already marked)
B marked his successors are D, B and E (E already marked)
C marked, its successors are B and E (already marked)
D marked, its successors are F and C (C already marked)
F marked, its successors are B and E already marked
We have the paths (E, A, C), (E, A, C, B), (E, A, B, D, F ) ; (E, A, B, D), (E, A).
Algorithme de DIJKSTRA
In the case of valuated graphs, we can search for the minimum value path between two
vertices of the graph. Several algorithms allow such a search. We are interested in the
DIJKSTRA algorithm for positive value graphs.
Algorithm
(i) Let S = x0 . Let L(x) be the partial distance from x0 to x.
L(x0 ) = 0, L(y) = ν(x0 , y) (x0 , y) ∈ E; L(y) = +∞, otherwise .
(ii) As long as S 6= X do
(a) Choose x ∈ E/S of L(x) minimum.
(b) Put S = S + {x} .
(c) For all y ∈ E/S, successor of x , pose : L(y) = min(L(x) + ν(x, y) ;L(y)).
If we define for each vertex xj its father as the vertex xi having allowed to fix lambdaj
17
(thus λj − λi = vij ), we have a tree structure of minimal paths
Example 1.6.1 we consider the graph below and look for the shortest paths from C.
18
Resolution
Step 1
Step 2
19
Step 3
20
Step 4
21
Step 5
22
Step 6
23
Step 7
24
Step 8
25
Step 9
26
Step 10
27
Step 11
28
Step 12
29
Step 13
30
Paths
31
Excercise 1: Find the shortest paths from A in the graph below.
Solution
Let’s look for the paths from A.
The shortest paths are: (A, E); (A, E, D); (A, E, B); (A, E, B, D).
Exercise 2:
Let’s look for the shortest original path A.
32
Solution
33
Chapter 2
SCHEDULING PROBLEMS
Introduction
34
Scheduling problems can be found in administration (human resources management,
time schedules), production (production workshops, etc.), projects (project
management, etc.) and IT (programme execution, code optimisation).
For the resolution of scheduling problems three methods are commonly used: the For
the resolution of scheduling problems three methods are commonly used: the bar chart
method (GANTT diagram) and two classical methods using graphs: the MPM
(potential-task method) and the PERT (project evaluation and review techniques)
method.
This method takes into account the succession constraints and the temporal constraints
(called constraints).
It was used for the construction of the liner France. The procedure is as follows:
• an arc defines a precedence relationship; the value of an arc defines the minimum
35
precedence time between two successive tasks (task duration).
• A fictitious terminal vertex allowing to date the end of the work is added to the graph.
The graph is ordered by task level.
Example
36
For non-critical tasks, there is some leeway. The maximum delay that can be taken
without delaying the project is called the total slack of a task. Mi = t∗i − ti
Remark 2.2.1 Two arcs should not have the same origin and end. It is sometimes
necessary to to add dummy tasks of zero duration to translate the problem.
37
Example
Tasks precedence Duration
A - 3
B - 9
C - 5
D A 8
E B 4
F B 7
G B 20
H C; F 6
I D; E 5
38
2.3 GANTT diagram
This diagram, also known as the project monitoring schedule (or production schedule),
is used to visualise the results.
Tasks are placed at their earliest start and represented by a horizontal segment whose
length is the duration of the task. Critical tasks are shown as a solid line. The total
margins are The total margins are shown as dashed lines.
Example:
The following scheduling problem is considered
The units of time are plotted on the x-axis and the individual tasks on the y-axis.
The duration of a task is shown as a horizontal bar
39
Chapter 3
TRANSPORT PROBLEMS
40
Example
3.2.1 Introduction
Flows can be used to model a very broad class of problems. Their interpretation
corresponds to the circulation of physical flows on a network: electrical distribution,
water supply network, routing of packets on the Internet, etc. The aim is to transport
the largest possible quantity of material between a source S and a destination P . The
links used to route the flows have a limited capacity, and there is no loss or creation of
material during the routing: for each intermediate node of the network, the incoming
flow (what arrives) must be equal to the outgoing flow (what leaves)
3.2.2 Definition
41
have :
X X
fij = fki .
j∈Γ + (i) k∈Γ − (i)
X X
F = fsj = fjp
j∈Γ + (s) j∈Γ − (p)
42
3.3 Maximum flow problem
The maximum flow problem consists, given a transport network, in finding a flow that
maximises F i.e. a flow with maximum throughput ( Suppose that each arc of the graph
represents a pipe. The capacity of the arc indicates the maximum amount of flow that
can pass through this arc). The maximum flow problem then consists of to pass the
maximum amount of traffic from the source s, while respecting the capacities of each arc.
3.3.1 Saturation
An arc (i; j) is saturated by a flow F if the value of the flow on the arc equals its
capacity fij = cij . A path is saturated if one of its arcs is saturated.
The residual capacity of an arc (i, j) is the quantity cij − fij of flow that can still pass
through it. The residual capacity of a path is the smallest residual capacity of its arcs.
Saturating a path p from s to p consists in increasing the flow of its arcs by the
residual capacity of the path.
A feasible or compatible flow is a flow where there are arcs u such that 0 ≤ fij ≤ cij for
any arc (i; j) of V . A such represents a feasible supply.
Remark 3.3.1 A complete flow is a flow such that any path from s to p contains a
saturated (i; j) arc (verifying fij = cij ).
X X
F = fsj = fjp
j∈Γ + (s) j∈Γ − (p)
43
W : V −→ N we will note Wij the cost of transporting a unit of flow on the arc (i; j).
s (the source) and p (the sink).
The problem is to route a given flow rate F from s to t, which minimises the total cost.
In particular, if F is then we look for a maximum flow with minimum cost.
44
to mark p with the residual capacity of the arcs of the path. Delete the marks, except
for s, and go to (I).
δ + = min(Cu − f (u)) with u direct arc of c and δ − = min(Φ(u)) with u indirect arc of c,
δ + = min(δ + , δ − )
For indirect arcs, remove δ and for direct arcs increase δ.
45
Part II
LINEAR PROGRAMMING
46
Companies, households, administrations, etc. set objectives that require various types of
often limited and restrictive means to achieve. often limited and restrictive. The
achievement of objectives requires a judicious use of resources, and therefore an
resources, and therefore an optimal allocation of these resources. Linear programming is
the best known technique in OR. It allows one or more optimal solutions to be chosen
from among many possible solutions, taking into account a set of constraints that must
be respected simultaneously, with a view to achieving an objective represented by a
function called the "economic function". economic function".
The constraints and the economic function are defined in relation to the variables of the
problem to be treated and are represented by linear functions.
The economic function is expressed as an equation, the constraints as equations or
inequations. They form a system which can be solved graphically or by calculation.
The optimum (maximum or minimum) is a level of the economic function that cannot
be improved
47
Chapter 4
Example 4.1.2 A factory produces two types of product which we will call A and B for
48
simplicity. These two products are sold in different markets. The production of the two
products requires two raw materials E and F and the production conditions are
summarised in the table below The production conditions are summarised in the table
below:
During the month of January, raw material supply problems arose and the factory could
not have more than 12 tonnes of material E and 14 tonnes of material F.
How can the factory allocate raw materials to make the most profit in the production of
the two products?
4.2 Modelling
Generally there are three steps to follow in order to be able to build the model of a
linear program:
• Identify the variables of the problem with unknown values (decision variable) and
represent them in symbolic form (e.g. x1 , x2 ; .... ). They are easily identified through
questioning.
• Identify the restrictions (constraints) of the problem and express them by a system of
equations or linear inequations.
• Identify the objective or selection criterion and represent it in linear form as a function
of the decision variables. Specify whether the selection criterion is to be maximised or
minimised.
4.2.1 Example
49
The constraints in addition to the non-negativity constraints are :
11x1 + 9x2 ≤ 9900 for the M1 machine
7x1 + 12x2 ≤ 8400 for the M2 machine
6x1 + 16x2 ≤ 9600 for the M3 machine
The profit to be maximized is: z = 900x1 + 1000x2 .
The resulting linear program is :
M axz = 900x1 + 1000x2
11x1 + 9x2 ≤ 9900
7x + 12x ≤ 8400
1 2
Constrained
6x1 + 16x2 ≤ 9600
x ≥ 0, x ≥ 0
1 2
Example 4.2.2 Let us denote by x and y the respective quantities (in tons) of items A
and B to be manufactured.
The problem amounts to maximising the function z(x, y) = 4x + 3y, called the economic
function, by respecting the constraints :
3x + 4y ≤ 12 availability of raw material E
7x + 2y ≤ 14 availability of raw material F
x ≥ 0 the quantities must be positive
y ≥ 0 Similar
The problem is written as :
M axz = 4x +3y
3x + 4y ≤ 12
Constrained 7x + 2y ≤ 14
x ≥ 0, y ≥ 0
n
X
z(x1 , x2 , ..., xn ) = cj x j = c1 x 1 + c2 x 2 + c3 x 3 + · · · cn x n
j=1
50
or merely
n
X
z= cj x j
j=1
n
X n
X
aij xj ≤ (or ≥)bi , i = 1, ..., p; or aij xj = b1 , i = p + 1, ..., n xj ≥ 0, j = 1, ..., q
j=1 j=1
and xj ∈ R, j = q + 1, ..., n.
A LP problem is generally written in the form
It can be reduced to two main forms which are the canonical form or the standard form:
51
4.2.3 Canonical form (for a minimisation problem)
Remark 4.2.3 For a maximization problem, the constraints of type ≤ are retained .
The canonical form will be written as the form :
maxz = nj=1 cj xj
P
Pn
j=1 aij xj ≤ bi
x ≥ 0, j = 1, ..., n
j
52
n
X n
X
aij xj ≥ bi ⇔ aij xj − xei = bi , with xei ≥ 0
j=1 j=1
0 0
by replacing x2 with (x2 − x3 )
Standard form :
0 0
maxz = 2x1 + (x2 − x3 )
0 0
x1 + 3(x2 − x3 ) − x4 = 4
0 0
3x1 − 4(x2 − x3 ) + x5 = 6
x1 + x6 = 7
x ≥ 0, x0 ≥ 0, x0 ≥ 0, x ≥ 0, x ≥ 0, x ≥ 0
1 2 3 4 5 6
4.3.1 Definitions
Consider the LP
53
The domain ∆ of admissible solutions of the LP is the set of points x ∈ Rn satisfying all
constraints (1.a); (1.b), (2) and (3). It is a polyhedron. It can be either empty; or
convex and bounded non-empty (polytope) or an unbounded convex polyhedron. Recall
that a polyhedron is the intersection of half-spaces ( nj=1 aij xj ≤ (or ≥)bi ) and/or
P
Pn
A point x ∈ Rn is a boundary point of (P) if j=1 aij xj = bi
A vertex of ( P) is a particular boundary point which cannot be expressed as a linear
combination of of other points of the polyhedron.
A face of (P) is a non-empty set of (P) belonging to a number of hyperplanes
Pn
j=1 aij xj = bi ; i = 1; ...; n
54
possibilities, it is the problem may have an optimal solution only in infinity
• If ∆ is empty, the problem has no optimal solution
The elements of the problem (constraints and objective function) are represented in an
orthonormal reference frame.
Consider the problem in Example 3 above
It has four constraints, two of which are obvious (x ≥ 0andy ≥ 0). Each constraint is
written as a linear first degree inequation (of the form ax + by ≤ c. In other problems,
some of the constraints may be written as equations of the form ax + by = c or
inequations of the form ax + by ≥c .
Each of the constraints must be represented graphically. The constraint 3x + 4y defines
a half-plane. To find it, draw the line with equation 3x + 4y = 12. It divides the plane
into two half-planes, one of which is the set of pairs (x; y) satisfying the constraint. It is
sufficient to take a point at random in one of the half-planes and to check its
compatibility with the constraint in order to retain or reject the half-plane in question
(f igure1). The same procedure with the constraints 7x + 2y ≤ 14; x ≥ 0 and y ≥ 0 gives
figures 2; 3 and 4.
A solution of the problem is a value of the variable (x; y) which simultaneously verifies
all the constraints of the problem. The domain of admissible or feasible solutions is the
area compatible with all constraints. The domain of admissible or feasible solutions is
the area compatible with all the constraints and is the non-hatched part of the last
figure.
55
4.3.4 Determining the optimum
16 21
The optimum corresponds to a production of 11
tonnes of product A and 11
tonnes of
product B. This corresponds to a total use of the available quantities of raw materials E
and F .
• The method of parallels
The economic function being z = 4x + 3y , the lines of equation x + 3y = c are called are
called isoprofit or iso-cost lines of isoprofits or iso-costs and have a direction vector
→
u (3, −4). The pairs (xy) of these lines give the same same value of the economic
function. They are parallel. In practice we draw the line 4x + 3y = 0 we move it in the
→
direction and the sense of the vector u0 (4, 3) to increase the value of z and in the
opposite direction to decrease the value of z. We retain the one that cuts the domain of
admissible solutions and gives a maximum value of z in our case. (see figure 6).
56
57
58
4.3.5 Examples
In this section we give some examples of graphical solving of linear problems related to
the different possible cases:
1.Problem of maximisation
The value of the objective function can be increased in the direction of the
59
arrows indefinitely, so the solution is unbounded
3. Impossible problem
The space of feasible solutions is empty, it is the intersection of the two grey
areas in the figure above
4. Multiple solution problem
The set of points described by the segment [AB] represents the optimal
solutions of the linear problem
5. Problem of degeneration
60
Chapter 5
SIMPLEX METHOD
When the number of variables is greater than two, graphical methods are more difficult
to apply. Quantitative methods are therefore used and the best known is the simplex or
DANTZIG method. This method uses the standard form of the linear program. An
admissible basic solution will be a vertex of the ∆ polyhedron, a set of admissible
solutions if it is non-empty.
61
5.1.1 Theoretical sketch of the simplex method
In this section we assume that the constraints are non-redundant and that there is an
basic admissible solution.
minz = cx
minz = cx
The LP problem Ax ≥ b can be written in standard form as Tx = b with
x≥0
x≥0
62
minz = a00 − α0 xR
form xB + AxR = a0
x≥o
The coefficients of this equivalent form constitute the simplex table associated with the
basic solution solution:
The simplex table provides at each step the current value of the economic function a00
and the value ai0 of the base variable xi , i ∈ I
be an admissible base solution and suppose that ∀k ∈ J such that a0k > 0 there exists at
least one index i ∈ I for which aik > 0. Let us define the index l by the relation
al0 ai0
= min ( )
alk i/aik >0 aik
Let there be a basic admissible solution. A sufficient and necessary condition, if the
problem is not degenerate, for this solution to be optimal, is that ∀j ∈ J, we have a
a0j ≤ 0.
63
Change of base
The iterative procedure of the simplex method consists in passing from a base B to a
base B ∗ which differs from the former one by one vector. I ∗ = I − l + k and
J ∗ = J − k + l.
The variable xk , k ∈ J is the off-base variable which becomes the base variable.
The variable xl , l ∈ I is the basic variable which becomes the non-basic variable.
We will say that the variable xk which enters the base and the xl which leaves the base.
We must therefore recalculate the simplex table corresponding to the new B ∗ . The
coefficient alk will be called the pivot of the base change.
The following basic formulas allow the new simplex table to be easily calculated from
the old one
These formulas can be broken down into rules for changing the base:
• Replace the pivot by its inverse
• Divide the other elements of the row of the pivot by the pivot
• Divide the other elements of the pivot column by the pivot and change the sign
• For the other elements apply the triangle rule
64
We will underline that the line α0 , coefficients of z are calculated in the same way.
al0 ai0
= min ( )
alk i/aik >0 aik
c. Calculate the new simplex table by applying the base change formulas.
Remark 5.2.1 • For a maximization problem, the algorithm remains valid with the
following modifications regarding the sign of a0j .
3. Test the a0j .
3. a. If a0j ≥ 0, ∀j ∈ J, the solution considered is optimal. STOP
3.b. If there exists j ∈ J te a0j < 0 and aij ≤ 0, ∀i ∈ I, there is no
optimal solution
4. change of base
65
a. Determine the index k of the variable that enters the base
= −3x1 + 5x2
minz
−2x1 + 3x2 ≤ 6
c: x1 − 4x2 ≤ 4
x ≥ 0, x ≥ 0
1 2
In this paragraph, we assume that the assumptions made in paragraph 2 are not
assured. Consider the LP
optz
= cx
Tx = d
with d ≥ 0
x≥0
we can always have this condition, even if it means change the signs in some constraints).
The linear LP is transformed into an LP a artificially. Artificial elements are introduced
so that the two hypotheses in question are fulfilled. We then apply to the LP a the
algorithm previously seen.
66
5.3.1 Constraints of the problem LP a .
To compensate for the introduction of artificial variables, they are introduced into the
economic function as follows as follows:
n
X n
X
a
min z = cj x j + M xaj
j=1 j=1
where M is a symbolic constant as large as desired. The algorithm will primarily try to
cancel the artificial variables to decrease the value of the economic function.
n
X m
X
min z a = cj x j + M xaj
j=1 l=1
Pn
t x + xai = di
j=1 ij j
The LP a is then x≥0
xa ≥ 0
Given that M is as large as we want, the artificial variables will be eliminated from the
database in the first place.
Two cases can occur:
• The algroithm shows that LP a has no finite solution, in this case the artificial
variables are all zero and LP a is unbounded.
• The algorithm determines an optimal solution of LP a .
◦ If in this solution there are still non-zero artificial variables, this indicates that it is
67
impossible to cancel all artificial variables and the LP a problem is impossible.
◦ If in this solution all artificial variables are zero, this solution is a basic admissible
solution of LP a .
When an artificial variable leaves the database, it no longer enters and its column can
be deleted.
5.4 Duality
68
5.4.1 Formulation of the dual problem from the primal
Duality associates with any LP problem another LP problem called the dual of the
original program. In contrast, the original problem will be called the primal problem.
The dual is built on the following considerations:
• A primal minimization problem corresponds to a dual maximization problem and vice
versa
• To any primal constraint corresponds a dual variable which is non-negative if the
constraint is an inequality. The dual variable will have any sign if the constraint is an
equality
• To any primal variable corresponds a dual constraint. If the variable is subject to a If
the variable is subject to a non-negativity constraint, the dual constraint is an
inequality, if the variable is of any sign, the dual constraint is an equality is an equality
• The coefficients of the economic function of the primal LP become the second
members of the dual constraints. The second members of the primal constraints become
the coefficients of the economic function of the dual. of the dual
• The coefficient of the variable xj in constraint i becomes, in the dual, the coefficient of
the variable ui in constraint j.
69
Example 5.4.1
Property 5.4.2 (weak duality):If x and u are admissible solutions of the primal and
dual respectively, they satisfy cx ≥ ud.
Corollary 5.4.3 If z and w are the optimal solutions of two problems we have :
~ z ≥ ud, ∀u eligible for the dual
~ w ≥ cc, ∀x eligible for primal .
70
Corollary 5.4.4 If x and u are admissible solutions of the primal and dual respectively,
if cu = u, x, and u are optimal.
Corollary 5.4.5 If a problem has an infinite optimal value, its dual is impossible.
71
Bibliography
[1] Hêche, J. F., Liebling, T. M., and De Werra, D. (2003). Operations Research for
engineers (Vol. 2). PPUR polytechnic presses.
72
Part III
73
5.5 Exercises
Exercise 1
Consider the graphs below:
74
Graph 2
1. Give the successors of vertex E in graph1. Give the predecessors of C in graph 2.
2. Determine all the arcs of graph 2.
3. Give all the circuits of origin A in graph 2.
Exercise 2
The following project is given:
tasks A B C D E F G
Task durations 4 7 5 6 5 3 2
Predictive constraints A A, B C C, D F
Draw the MPM potential-task graph. Are there any tasks that can be delayed without
compromising the duration of the the project? Justify your answer.
Exercise 3
1. We give a graph G defined by its precedence diagram:
tasks Predictive constraints
A D
B -
C B, D
D B
E C
F E, D
G E, F, I
H C
I A
75
tasks Task durations Predictive constraints
P 5 W
Q 4 P
R 2 Q
S 9 V
T 6 S
U 4 P
V 5 -
W 6 -
A 2 Q
Exercise 6
Consider the following power supply problem:
The aim is to produce an economical feed for animals, which must contain 4 types of
nutrients A, B, C and D. The food industry produces precisely two feeds M and N which
contain these components these components: 1 kg of feed M contains 100 g of A, 100 g
of C g of C, 200 g of D; 1 kg of food N contains 100 g of B, 200 g of C, 100 g of D.
An animal must consume at least: 0.4 kg of A ; 0.6 kg of B; 2 kg of C and 1.7 kg of D.
Feed M costs 1000FCFA per Kg and N costs 4000FCFA per Kg. What quantities of M
76
and N feed should be used per day per animal to achieve the cheapest feed? What is the
most cost effective animal feed? N.B 100g=0,1Kg)
QUESTION : Model this feeding problem by a linear program.
Exercise 7
1. Put the linear problem below into canonical and standard form.
= −3x1 − 2x2
maxz
x1 − x2 ≥ −4
3x + 2x ≤ 14
1 2
c:
x1 + x2 ≤ 3
x ≥ 0, x ≥ 0
1 2
Exercise 8
The graph G below is given
77
c) Find all the paths with origin A and final end F .
Exercise 9
The project below is given.
tasks duration in days precedence constraints
A 3 C
B 14 L, K, J
C 2 -
D 11 -
E 13 D
F 22 D
G 17 C
H 6 I,J
I 10 G
J 15 A
K 6 G, E
L 12 A, F
78
The company has 200 hectares of cultivable land, 250 workers and ten tons (10,000kg) of
fertiliser. (10,000kg) of fertiliser.
How much of each type of grain can the company produce to make the most profit in
the can produce to make the most profit in the production of the three types of grain?
production of the three types of grain? Write the problem as a linear program, which we
will not solve.
79