Download as pdf or txt
Download as pdf or txt
You are on page 1of 83

Acadmic year : 2023-2024

··················
Pathways : CS
··················
Second year / Semester IV

OPERATIONAL RESEARCH

Course volume : 20H


Tutorial : 10H
Practical work : 10H

Teacher : Hamed OUEDRAOGO


Email : [email protected]

Date : January 2024


Contents

I GRAPH THEORIES 2

1 GENERALITIES AND DEFINITIONS 4


1.1 Undirected graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.1 Degree of an undirected graph . . . . . . . . . . . . . . . . . . . . . 5
1.1.2 Subgraphs, partial graphs . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 Oriented graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Valued graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.1 Paths and circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.2 Chains and cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4.3 Colouring of a graph . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5 Structure of a graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.1 Adjacency list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.2 Level in a graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.6 Exploring a graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

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

4 SOLVING LINEAR PROGRAMS WITH TWO VARIABLES 48


4.1 Introductory examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.2 Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2.2 Some general information . . . . . . . . . . . . . . . . . . . . . . . 50
4.2.3 Canonical form (for a minimisation problem) . . . . . . . . . . . . 52
4.2.4 Standard form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.3 Graphical interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.2 Case of linear programs of two variables . . . . . . . . . . . . . . . 55
4.3.3 Domain of admissible solutions . . . . . . . . . . . . . . . . . . . . 55
4.3.4 Determining the optimum . . . . . . . . . . . . . . . . . . . . . . . 56
4.3.5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

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

III Operations Research tutorials 73


5.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

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

GENERALITIES AND DEFINITIONS

1.1 Undirected graphs


Definition 1.1.1 A non-oriented graph G consists of a non-empty set X of elements
called vertices or nodes and a set E of pairs {x; y} of various vertices, called edges. It is
denoted by G(X; E).

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:

This graph has 4 vertices, named A to D, with 4 edges.

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.

Remark 1.1.5 • A loop is an edge connecting the same vertex.


• A simple graph is a graph without loops and such that no pair of vertices is connected
by more than one edge.

1.1.1 Degree of an undirected graph

} 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.

Property 1.1.6 1. (Wrist of Hands Lemma)


The sum of the degrees of the vertices of an undirected graph is equal to 2 times its number
of edges. Indeed: An edge a = (x, y) of the graph is counted exactly 2 times in the sum of
degrees: once in d(x) and once in d(y).
2. The number of vertices of odd degree in a graph is even. This can be demonstrated by
the absurd.

1.1.2 Subgraphs, partial graphs

To characterise the structure of a graph locally, it is possible to search for remarkable


parts of the graph, by restricting either the set of vertices (sub-graph) or the set of edges
(partial graph).
} A subgraph of G consists in considering only a part of the vertices of X and the links
induced by E. For example if G represents the daily air links between the main cities of
the world, a possible subgraph is to restrict oneself to the daily links between the main
European cities.
} A partial graph of G consists in considering only a part of the edges of E. Using the
same example, a possible partial graph is to consider only the daily connections of less
than 3 hours between the main cities of the world.

Definition 1.1.7 For a graph G(X, E)


• A subgraph of G is a graph H(Y, E(Y )) such that Y is a subset of X, and E(Y ) are the
edges induced by E on Y , i.e., the edges of E whose 2 ends are vertices of Y .
• A partial graph of G is a graph I(X, F ) such that F is a subset of E. A subgraph H of
G is fully defined (induced) by its vertices Y , and a partial graph I by its edges F .

1.2 Oriented graphs


Definition 1.2.1 A directed graph G consists of a non-empty set X of elements called
vertices or nodes and a set E of pairs ei = (x, y) of various vertices, called edges or arcs.
It is noted G(X; E).

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:

Example of a directed graph.

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.

1.3 Valued graph

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

1.4.1 Paths and circuits

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.

Exercise: In the graph above, name the paths.


A circuit is a directed path (x, ..., y), with the additional condition that (y, x) is an arc.
The initial end The initial endpoint merges with the terminal endpoint. Example: Give
at least one circuit in the above graph
Elementary path/simple path: A path is said to be elementary (respectively simple)
if it does not pass twice through the same vertex (respectively arc).
Example: In the graph below the paths [E, C, D, F ] and [C, A, B, D, F ] are elementary
while the path [E, C, A, B, A, B, D, F ] is not elementary. It is not as simple.

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.

1.4.2 Chains and cycles

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.

1.4.3 Colouring of a graph

A colouring of a graph consists in the attribution of colours to the vertices, so that two
adjacent vertices never have the same colour.

Chromatic number : The chromatic number of a graph is the minimum number of


colours necessary for its colouring, i.e. the smallest number of colours allowing to colour
all the vertices of the graph without two adjacent vertices are of 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.

1.5 Structure of a graph

1.5.1 Adjacency list

Let G(X; E) be a graph and xi a vertex of this graph. xj is successor of xi if (xi , xj ) ∈ E


and xi is predecessor of xi if (xi , xj ) ∈ E.
• The set of successors of xi is denoted Γ (xi ).

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.

Incidence list The directed graph G = (X; E) is represented by :


1. the number of vertices n ;
2. n lists A1 ; · · · ; An , where Ai contains the arcs which begin with the vertex number i.
Let the graph given in the figure above be the graph. Its data structure is given as
follows:
1. n = 6 ,
2. A1 : (1; 3); (1; 5); A2 : (2; 3); (2; 5); (2; 1); A3 : (3; 4); A4 : (4; 1); A5 : (5; 2);
A6 : (6; 5); (6; 4); (6; 3).
Adjacency list The directed graph G = (X; E) is represented by :
1. the number of vertices n ; 2. n lists A1 ; · · · ; An , where Ai contains all the vertices j
for which there is an arc (i; j); i.e. its list of successors.
Let the graph given in the figure above be :
Its data structure is given as follows:
1. n = 6,
2. A1 : 3; 5; A2 : 3; 5; 1; A3 : 4; A4 : 1; A5 : 2; A6 : 3; 4; 5.
The adjacency list of a graph is a representation of this graph in the form of a table
where each row corresponds to a vertex and contains the list of its successors and/or
predecessors.
The precedence dictionary of a graph is an array in which each vertex is mapped to its
predecessors.
Adjacency list

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

The directed graph G = (X; E) is represented by a matrix n × n , A = (aij ) where


aij = 1 if and only if there is an arc (i; j) in the graph G, otherwise aij = 0.
Let us consider the graph given in the figure above. Its data structure is given as follows:

1.5.2 Level in a graph

Definition 1.5.1 Let G(X, E) be a directed graph without circuits.

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 :

The precedence dictionary is :

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:

1.6 Exploring a graph


The exploration of a graph consists in the search for paths under certain conditions. We
can search for a path connecting a vertex x to a vertex y, the shortest path connecting
two vertices x and y. The exploration of a graph since a summit x, consists in starting
from x, in marking all the adjacent paths to x; then in marking the adjacent summits to
these summits and so on.
Algorithm for finding paths from an initial vertex x.
Step 1: om mark x and initialise all vertices to "unmarked".
Step 2: As long as there is an unmarked vertex adjacent (successor for directed graphs)
to a marked vertex select the unmarked vertex and mark it.
Example

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

One mistake: 20G instead of 28A

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

Scheduling problems are encountered when,in order to achieve any objectives,it is


necessary to complete a set of tasks (or operations), themselves subject to a set of
constraints. The constraints to which the various tasks contributing to the achievement
of the objective are subject are of various types.
These include :
• Potential type constraints which are time constraints. (i.e., task i must not start
before such and such a date), succession or posteriority constraints (i.e. task i must
start after task j, ...).
• Disjunctive type constraints which impose the disjunction between tasks, which
cannot be performed simultaneously.
• Cumulative type constraints, which concern not exceeding the available resources
during the duration of the project.
A schedule is therefore a solution to the scheduling problem. It includes the execution
schedule (dates of execution of tasks) and the allocation of resources. It aims to satisfy
the objectives of the project and the constraints mentioned above.
One of the usual objectives is to minimise the end date of the project. However, other
criteria are also interesting from an industrial point of view:
• Minimisation of the weighted sum of late tasks ;
• Minimise the (weighted) sum of late tasks ;
• Minimisation of the (weighted) sum of finish dates ;
• etc.

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.

2.1 The potential-task method or MPM

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:

2.1.1 Construction of the graph

The graph is a directed and valuated graph.


• An initial dummy vertex to date the start of the work begins the graph
• A vertex represents a task and is represented by a rectangle as below where ti and t∗i
denote respectively the earliest start date of the task and the latest start date of the
task i with :
ti is the value of the maximum value path to i from the initial y leading vertex.
t0 = 0, ti = max(tj + val(j; i)) ( with j predecessor of i).
t∗i is the latest date at which a task must start without compromising the t end date
of the work, i.e. the earliest start date of the terminal dummy task. For the terminal
vertex t∗ = t while for any vertex i: t∗i = min(t∗j − val(i; j)); j successor of i each vertex
is represented by a rectangle 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

Constrained tasks Duration (in hours) Precedence constraints


C 3
A 7
B 4 Task C
E 6 Tasks C and A
F 5 Task B
G 3 Tasks B and E
D 2 Task G

2.1.2 Exploitation of the graph

The graph provides several types of information:


• The minimum duration of the project (18H) for our example.
• The earliest and latest start dates for each task.
When t∗i = ti the task i is called critical. Its execution must not be delayed in any way,
otherwise it will compromise the earliest possible completion of the project. Critical
tasks can form one or more critical paths.

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

2.2 The method: Program Evaluation and Review


Technic or PERT

2.2.1 Construction of the graph

The graph is a directed and valuated graph with :


• An arc corresponds to a task and its value represents the duration of the task
• A vertex is a step meaning that incoming y tasks are completed and outgoing can
start. It is represented by a circle indicating the step number (n), the earliest start date
of the step.It is represented by a circle indicating the number of the step (n), the earliest
start date of the step (tn ) and the latest start date of the step (t∗n ).

• An initial dummy vertex and a terminal vertex complete the graph.


• The graph is ordered by levels
• tn = max(tk + dkn ) with k predecessor of n and dkn the duration of the task linking
the steps k and n with t0 = 0
• t∗n = min(t∗j − djn ) with j successor of n and djn the duration of the task linking the
steps j and n with tN =latest end date of the project and N the last step.

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

Remark 2.2.2 the vertices can be numbered in ascending order of rank

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

Task Duration Posteriority constraints


A 3
B 7
C 4 A
D 6 A; B
E 5 C
F 3 C; D
G 2 F

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

A transport problem consists in maximising the quantity of products transported from


one or more sources to one or more destinations. It is modelled by a valued graph,
called a transport network, which we will define.
The arcs represent the transport possibilities between two locations and are valued by
the corresponding capacities.

3.1 Definition of a transport network


A positively valuated graph without loops, having a root s, a sink p, is called a
transport network. The valuations of the arcs are called capacities. It is a valuated
graph G = (X, V, C, s, p) with X the set of its vertices, V the set of its arcs,
C : V −→ N, we will note Cij the maximal capacity of the arc (i, j). Two particular
vertices s (the source) and p (the sink) such that d− (s) = 0 and d+ (p) = 0.
Recall that for a vertex xinX, Γ + (x)(respectively Γ − (x)) denotes the set of ends
(respectively origins) of arcs having x as their origin (respectively end). We also recall
that d+ (x) is the number of elements of Γ + (x) (respectively d− (x) the number of
elements of Γ − (x)).

40
Example

3.2 Definition of a flow in a transport network

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

We call a flow on a transport network G = (X, E, C) an application f : V in R+ which,


to each arc (i; j) associates its value of the flow f (i; j) noted fij and verifies :
• The capacity constraints :
for any arc (i, j) of V : 0 ≤ fij ≤ cij ;
• Conservation constraints (Kirchoff): for any vertex i of X distinct from s and p, we

41
have :

X X
fij = fki .
j∈Γ + (i) k∈Γ − (i)

Remark 3.2.1 We have :

X X
F = fsj = fjp
j∈Γ + (s) j∈Γ − (p)

and F is called the flow value or flow rate.

Example 3.2.2 A product is to be delivered from 3 warehouses (1, 2, 3) to 4 customers


(a, b, c, d) with the following constraints the following constraints :

Stock quantities: 45, 25, 25


Customer demand: 30, 10, 20, 30
Limitations on transport from a warehouse to a customer

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.

3.3.2 Achievable float

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 ).

3.3.3 Maximum float

A maximum flow is a feasible flow of maximum throughput, i.e. maximising

X X
F = fsj = fjp
j∈Γ + (s) j∈Γ − (p)

3.4 Maximum flow at minimum cost


Consider a valued graph G = (X, V, C, W, s, p) with X the set of its vertices, V the set
of its arcs.
C : V −→ N , we will note Cij the maximal capacity of the arc (i; j).

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.

3.5 Finding a maximum flow: Ford-Fulkerson


algorithm

3.5.1 Improving chain

In a path from s to p, the direction of the arcs is respected. In a chain from s to p, on


the contrary, the direction of the arcs is not necessarily respected. We can then
distinguish two types of arcs: the arcs which respect the orientation (arcs said to be in
direction) and arcs that do not respect the orientation (arcs in the - direction). An
improving chain is a chain from s to p whose arcs in the + direction are unsaturated
and whose arcs in the − direction carry a strictly positive. It improves the flow, by
adding a quantity δ on the arcs in the + direction, and by removing a quantity δ on the
arcs in the - direction.
The Ford-Fulkerson algorithm starts from any stream (for example, the null stream or a
complete stream). It looks for an improving chain. It improves the flow as long as there
is an improving chain, otherwise it stops. The flow is then optimal.

3.5.2 Ford-Fulkerson algorithm

(I) Mark the entry s with ∗.


(II) Let i be an unexamined marked vertex.
Mark j if it is unmarked and if fij < cij by +i.
Examine all successors j of i :
Mark k if it is unmarked and if fki > 0 by −i.
(III) If p is marked, go to (IV ).
If there remain marked not examined summits, go in (II).
Otherwise the flow is optimal, END.
(IV) Improve the flow with the help of the improving chain having allowed

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

SOLVING LINEAR PROGRAMS


WITH TWO VARIABLES

4.1 Introductory examples


Example 4.1.1 : production problem 2
To produce two products P 1 and P 2, operations must be performed on three machines
M 1, M 2 and M 3, successively but in any order. The unit execution times are given by
the following table following table:

It will be assumed that the machines have no idle time.


The availability for each machine is :
165 hours (9900 minutes) for machine M 1
140 hours (8400 minutes) for the M 2 machine;
160 hours (9600 minutes) for machine M 3.
Product P 1 gives a unit profit of 900 francs and product P 2 a unit profit of 1000 francs.
Under these conditions, how many products P 1 and P 2 must be produced each month to
obtain a total profit profit ?

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

Example 4.2.1 : production problem


The decision variables are : x1 : the number of units of product P 1 to be manufactured
x2 : the number of units of product P 2 to be manufactured

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 = 900x1 + 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

4.2.2 Some general information

In modelling a linear programming problem, decision variables of quantitative types will


be expressed as xi . The objective should be expressed as a linear function :

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

The cj are real numbers that can be positive, negative or zero.


The constraints related to the problem are unavoidable because they define the problem
to a large extent. They are expressed in the form of equations or linear inequations
linking the variables. there may be constraints of of the form

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)

• The constraints of type ≤ are retained 


 α≤β
• The equality constraints are duplicated because α = β ⇔
 α ≥ β ⇔ −α ≤ −β
Therefore 
n Pn
j=1 aij xj ≤ bi
X 
aij xj = bi ⇔
 − P n
j=1 a x ≤ −bj=1 ij j i
Pn Pn
• The constraints j=1 aij xj ≤ bi are transformed into − j=1 aij xj ≥ −bi .
• All variables must be non-negative. Any variable is decomposed into the form
− −
xj = x+ +
j − xj with xj = max(xj ; 0) and xj = max(−xj ; 0).

We then obtain the canonical form of a minimisation problem in the form



minz = nj=1 cj xj
 P



Pn
 j=1 aij xj ≤ bi

 x ≥ 0, j = 1, ..., n

j

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

4.2.4 Standard form

An LP is said to be written in standard form if :


1. all the constraints are of type equality ,
2. all variables are positive
This equivalent form is obtained by transforming the inequality constraints into equality
constraints by introducing non-negative gap variables that measure the positive gap
between the first and second members of the inequality members of the inequality
constraints
n
X n
X
aij xj ≤ bi ⇔ aij xj + xei = bi , with xei ≥ 0;
j=1 j=1

52
n
X n
X
aij xj ≥ bi ⇔ aij xj − xei = bi , with xei ≥ 0
j=1 j=1

The standard form is : 


minz = nj=1 cj xj
 P



Pn
 j=1 aij xj = bi

 x ≥ 0, j = 1, ..., n

j

Example 4.2.4 We have


 
0 0


 maxz = 2x1 + x2 

 maxz = 2x1 + (x2 − x3 )

 

 x + 3x ≥ 4
  −x − 3(x0 − x0 ) ≤ −4

1 2 1 2 3
⇔ canonical f orm 0 0
 3x1 − 4x2 ≤ 6

  3x1 − 4(x2 − x3 ) ≤ 6



 

 x ≥ 0, x ∈ R
  x ≥ 0, x0 ≥ 0, x0 ≥ 0 ∈ R

1 2 1 2 3

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 Graphical interpretation

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

hyperplanes ( nj=1 aij xj = bi ) Its equation can be written as (P) :


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

Property 4.3.1 Geometric characterisation of admissible solutions


• If ∆ is polytope :
◦ Either the optimal solution is unique and it is located at a vertex of ∆ :
◦ Or there exists an infinite number of optimal solutions which are the points of a face of
∆ and are linear combinations of a finite number of vertices.
• If ∆ is a convex polyhedron, non-empty but not bounded, in addition to the above

54
possibilities, it is the problem may have an optimal solution only in infinity
• If ∆ is empty, the problem has no optimal solution

4.3.2 Case of linear programs of two variables

The elements of the problem (constraints and objective function) are represented in an
orthonormal reference frame.
Consider the problem in Example 3 above

4.3.3 Domain of admissible solutions

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

There are two possibilities:


• Summit census
The optimum is obtained at one vertex. When the number of vertices is not high, we
can therefore count them and calculate the values of the economic function
corresponding to each of them and determine the largest or the largest calculate the
values of the economic function corresponding to each of them and determine the largest
or smallest the largest or smallest according to the objective (maximisation or
minimisation). In our case we have the vertices :

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 optimal solution is B(40, 110).


2. Problem with unbounded solution

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

The optimal solution B(10.5) is said to be degenerate if three constraints


converge at this point.

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.

5.1 Basic concepts

Basic concepts The simplex method uses a so-called simplex algorithm. It is an


intelligent procedure that uses an iterative procedure that will converge to the optimal
solutions of the economic function or, failing that, show that the program does not
admit of an optimal solution. The algorithm contains two phases:
• Phase I: Initialization.
Determine a first admissible base solution, i.e. the coordinates of a first vertex of ∆
domain of admissible solutions. If this procedure fails, it will mean that ∆ is empty and
the problem is impossible (the constraints cannot be satisfied simultaneously).
• Phase II: iteration
Compute, from an admissible basic solution, another admissible basic solution giving a
better value of the economic function. This is done by moving from one vertex to an
adjacent vertex.
A stopping procedure of the algorithm is based on two tests that prove the existence of
an optimal solution or not.

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

T (m × n), c(1 × n), x(n × 1), d(m × 1).


When
 a base B is available, we can transform the problem into the form


 minz = cB xB + cR xR

BxB + RxR = d


 x≥0

with
T (B, R), B(m × m), R(m × m − m), cB (1 × n), cR (1 × n − m), xB (m × 1), xR (n − m × 1).
xB (xi , i ∈ I), m basic variables
xR (xj , j ∈ J), n-m off-base variables 
 x = B −1 d ≥ 0
B
The initial admissible basic solution is The problem can be written
 x =0
R
in equivalent form as :
• Diagonalizing the constraints with respect to the basic variables (we can use the gauss
method)
• Eliminating the non-basic variables in the expression of the economic function.
Let’s multiply the constraint BxB + RxR = d by B −1 we obtain xB + B 1 RxR = B −1 d, so
xB = B −1 d − B −1 RxR .
By replacing xB in the economic function z = cB (B −1 d − B −1 RxR ) + cR xR , i.e
z = cB B −1 d − (cB B −1 R − cR )xR .
In the following, we adopt the following notation :
B −1 R = A = (aij , i ∈ I, j ∈ J) of dimension (m × n − m)
B −1 tj = aj , j ∈ J, j me column of A
B −1 d = (ai0 , i ∈ I) = a0 of dimension (m × 1)
cB B −1 R − cR = (a0j , j ∈ I) = α0 of dimension
 (1 × m − m), so cB B −1 tj − cj = a0j
P


 minz = a00 − j∈J a0j xj

The problem in its equivalent form is : xi + j∈J aij xj = ai0 , i ∈ I and in matrix
P


 x≥o

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

Characterisation property of the absence of a finite optimal solution



 a <0
0k
Let there be an admissible basic solution; if there exists k ∈ J such that ,
 a ≤0
ik
∀i ∈ I. The economic function can be as small as desired, i.e. there is no finite optimal
solution.

Improvement property of an admissible basic solution

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

If we replace the base vector xl in the baseby the off-base vector xk .

Stop test: obtaining an optimal basic solution

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

This rectangle rule implies :


If there exists i ∈ I such that aik = 0, all aij , f orallj 6= k are not modified. The i line
remains identical.
If there exists j ∈ J such that alj = 0, all alj = 0, ∀i 6= l are not modified. The column j
remains unchanged.

64
We will underline that the line α0 , coefficients of z are calculated in the same way.

5.2 Concepts and simplex algorithm


Let be a linear programming minimization problem
1. Put the PL in standard form.
2. Determine an initial basis corresponding to an admissible basis
a. If there is no obvious one, apply the method of artificial variables
b. Put the PL in equivalent form and write the simplex table
Let I be the set of indices of the base variables and J the set of
non-base variables.
3. Test the a0j :
a. If a0j , ∀j ∈ J, the considered solution is optimal. STOP
b. If there exists j ∈ J such that a0j > 0, ∀i ∈ I , there is no finite
optimal solution and the value of the economic function is not bounded: minz = −∞ .
c. Otherwise perform a change of basis.
4. change of base
a. Determine the index k of the variable that enters the base

a0k = max(a0j > 0).


j∈J

b. Determine the index l of the variable which leaves the base

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

a0k = min(a0j < 0)


j∈J

• For an LP with all constraints in the form of inequalities, an admissible basis is


available. It is sufficient to take the deviation variables as the base variables.

Example 5.2.2 1. Consider the linear problem


maxz
 = 6x1 + 5x2


 x1 + x2 ≤ 8


 −2x + x ≤ 6

1 2
c:


 x1 − x2 ≤ 2


 x ≥ 0, x ≥ 0

1 2

2. Consider the linear problem

 = −3x1 + 5x2
minz


 −2x1 + 3x2 ≤ 6

c: x1 − 4x2 ≤ 4


 x ≥ 0, x ≥ 0

1 2

5.3 Use of artificial variables

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 .

• A non-negative artificial variable xa − i is added to each constraint. is added to each


constraint which becomes
n
X
tij xj + xai = di
j=1



 T x + Ixa = d

In matrix form the constraints become x≥0


 xa ≥ 0

• This new constraint system is non-redundant and moreover admits an admissible basis
( xa = d ). We can then apply the simplex algorithm

5.3.2 Economic function

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 .

Remark 5.3.1 For a maximization problem the economic function is


max z a = nj=1 cj xj − M m a
P P
l=1 xj

When an artificial variable leaves the database, it no longer enters and its column can
be deleted.

Example 5.3.2 1. Let be the following linear program:


maxz
 = 6x1 + 5x2


 x 1 + x2 ≥ 8


 −2x + x ≤ 6

1 2
c:


 x 1 − x2 ≤ 2


 x ≥ 0, x ≥ 0

1 2

2. Consider the linear problem


maxz
 = 6x1 + 5x2


 x 1 + x2 ≤ 8


 −2x + 3x ≥ 6

1 2
c:


 x1 − 4x2 ≥ 4


 x ≥ 0, x ≥ 0

1 2

5.4 Duality

Duality is an essential notion in mathematical programming, especially in linear


programming. programming. An LP problem (called primal) is associated with another
LP problem (called its dual) which is defined only with the data of the primal problem.
The interest of duality lies in :
• The important economic interpretation of the dual problem. It constitutes another
view of the initial problem
• The possibility of developing more efficient algorithms given the mathematical
properties linking the primal and the dual.

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.

Tableau de correspondance primal-dual

69
Example 5.4.1

5.4.2 Theorem of duality





 minz = cx

Consider a linear minimization problem in canonical form and its dual : Ax ≥ d


 x≥0




 maxw = ud

; uA ≤ c


 u≥0

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.

Property 5.4.6 strong duality:


If the primal (dual) problem has a finite optimal solution then so does its dual (primal)
and in this case u = w

Fundamental duality theorem


Let be a linear problem and its dual. There are three possible situations:
1) Both problems have optimal solutions
2) a) The primal problem is unbounded, and the dual is impossible
b) The dual problem is impossible and the primal is unbounded
3) Both problems are 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.

[2] Teghem, J. (2012). Operations Research Volume 1. Ellipses, Paris.

[3] Chauvet , F. (2005). Operational research (Doctoral dissertation,


UPMC-Université Paris 6 Pierre and Marie Curie; Ecole Centrale Paris)

72
Part III

Operations Research tutorials

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

Rearrange the graph by level and represent it


Exercise 4
The project below is given.

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

1. Reorganise tasks by levels


2. Draw up PERT and MPM graphs. Are there any critical If so, specify them.
Exercise 5
Write the linear problem below in standard form and write the first simplex table taking
the deviation variables as the basis. taking the deviation variables as a basis. Perform
the tests for the variable that enters the base and the variable that the one that comes
out:
maxz
 = 2x1 + x2


 x1 − x2 ≤ 3


 x − 2x ≤ 6

1 2
c:


 −x1 + 2x2 ≤ 2


 x ≥ 0, x ≥ 0

1 2

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

2. Solve by the simplex method the linear program


maxz
 = 2x1 x2


 x1 − x2 ≤ 3


 x + 2x ≤ 6

1 2
c:


 −x1 + 2x2 ≤ 2


 x ≥ 0, x ≥ 0

1 2

Exercise 8
The graph G below is given

a) Determine the precedence dictionary of the graph


b) Give for each vertex its successors

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

1. reorganise tasks by levels


2. Draw up the MPM graph for the project. Are there any critical tasks? if so, specify
them.
Exercise 10
Three types of cereals A, B and C are produced by the the WEND-PANGA agricultural
company. The price of one tonne of grain, space requirements (cultivable land) (arable
land), labour and fertiliser requirements are given for each cereal for each cereal in the
table below:

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

You might also like