Computational Optimisation
Gregory Gutin
April 4, 2008 Contents
1 Introduction to Computational Optimisation 1 1.1 Introduction...... 1 1.2 Algorithm efficiency and problem complexity ...... 3 1.3 Optimality and practicality ...... 4
2 Introduction to Linear Programming 6 2.1 Linearprogramming(LP)model ...... 6 2.2 FormulatingproblemsasLPproblems ...... 6 2.3 GraphicalsolutionofLPproblems ...... 9 2.4 Questions ...... 13
3 Simplex Method 15 3.1 StandardForm ...... 15 3.2 SolutionsofLinearSystems ...... 17 3.3 TheSimplexMethod...... 18 3.4 Questions ...... 22
4 Linear Programming Approaches 25 4.1 Artificial variables and Big-M Method ...... 25 4.2 Two-PhaseMethod...... 26 4.3 Shadowprices...... 28 4.4 Dualproblem...... 29 4.5 DecompositionofLPproblems ...... 32
1 CONTENTS 2
4.6 LPsoftware...... 34 4.7 Questions ...... 34
5 Integer Programming Modeling 36 5.1 Integer Programming vs. Linear Programming ...... 36 5.2 IPproblems...... 37 5.2.1 Travelling salesman problem ...... 37 5.2.2 KnapsackProblem ...... 38 5.2.3 Binpackingproblem...... 38 5.2.4 Set partitioning/covering/packing problems ...... 39 5.2.5 Assignment problem and generalized assignment problem ...... 40 5.3 Questions ...... 41
6 Branch-and-Bound Algorithm 43 6.1 A Simple Example for Integer and Mixed Programming ...... 43 6.2 Knapsackexample ...... 48 6.3 Branchingstrategies ...... 50 6.4 MAX-SATExample ...... 51 6.5 Questions ...... 53
7 Construction Heuristics and Local Search 56 7.1 Combinatorial optimisation problems ...... 56 7.2 Greedy-typealgorithms ...... 57 7.3 SpecialalgorithmsfortheATSP ...... 59 7.4 Improvementlocalsearch ...... 61 7.5 Questions ...... 63
8 Computational Analysis of Heuristics 65 8.1 ExperimentswithATSPheuristics ...... 65 8.2 Testbeds...... 65 8.3 ComparisonofTSPheuristics ...... 68 CONTENTS 3
9 Theoretical Analysis of Heuristics 72 9.1 Propertyof2-Optoptimaltours ...... 72 9.2 ApproximationAnalysis ...... 73 9.2.1 Travelling Salesman Problem ...... 73 9.2.2 KnapsackProblem ...... 75 9.2.3 BinPackingProblem...... 76 9.2.4 OnlineProblemsandAlgorithms ...... 78 9.3 DominationAnalysis ...... 78 9.4 Questions ...... 80
10 Advanced Local Search and Meta-heuristics 82 10.1 Advanced Local Search Techniques ...... 82 10.2 Meta-heuristics ...... 83 10.2.1 SimulatedAnnealing ...... 83 10.2.2 GeneticAlgorithms...... 83 10.2.3 TabuSearch ...... 85 CONTENTS 4
Abstract
This notes accompany the final year course CS3490: Computational Optimisation. We will study basic results, approaches and techniques of such important areas as linear and integer programming, and combinatorial optimisation. Many applications are overviewed.
This document is c Gregory Gutin, 2005.
Permission is given to freely distribute this document electronically and on paper. You may not change this document or incorporate parts of it in other documents: it must be distributed intact. Please send errata to the authors at the address on the title page or electronically to [email protected]. Contents
i Chapter 1
Introduction to Computational Optimisation
1.1 Introduction
Computational Optimisation (CS3490) will have 3 lectures a week. The aim is to intro- duce classical and modern methods and approaches in computational optimisation, and to overview applications and software packages available. The course covers both classical and very recent developments in the area. The main topics of the course are: linear and integer programming, construction heuristics and local search, polynomial time solvable problems, computational and theoretical analysis of heuristics, and meta-heuristics. Most of the theory will be taught through examples with theoretical results formulated, but not proved. Only a few results will be proved. There will be a final exam (100 % mark). Any material taught at the lectures may be in the exam paper. A basic knowledge of graphs and matrices is assumed. These notes contain areas of blank space in various places. Their purpose is to leave room for examples given in the lectures. Unfortunately, it is impossible to recommend only one or two books covering the whole course. Several books and articles will be used in a supporting role to these notes, including the following:
J. Bang-Jensen and G. Gutin, Digraphs: Theory, Algorithms and Applications, • Springer, 2000
J.A. Bondy and U.S.R. Murty, Graph Theory with Applications, North Holland, 1976 • M.W. Carter and C.C. Price, Operations Research: A Practical Introduction, CRC, • 1 1.1. INTRODUCTION 2
2001
F. Glover and M. Laguna, Tabu Search, Kluwer, 1997 • G. Gutin and A. Punnen (eds.), Traveling Salesman Problem and its Variations, • Kluwer, 2002.
G. Gutin and A. Yeo, Anti-matroids. Operations Research Letters 30 (2002) 97–99. • J. Hromkoviˇc, Algorithmics for hard problems, Springer, 2001 • Z. Michalewicz and D.B. Fogel, How to Solve It: Modern Heuristics, Springer, 2000 • W.L. Winston, Operations Research, 3rd edition, Duxbury Press, 1994 •
Inevitably there are misprints in the notes. Please let me know if you have spotted one. 1.2. ALGORITHM EFFICIENCY AND PROBLEM COMPLEXITY 3 1.2 Algorithm efficiency and problem complexity
We start from two particular optimisation problems.
Assignment Problem (AP) We have n persons p1,...,pn and n jobs w1,...,wn, and the cost cij of performing job i by person j. We wish to find an assignment of the persons to the jobs (one person per job) such that the total cost of performing the jobs is minimum. The costs are normally given by matrix C = [cij]. Example (an instance):
1 2 3 2 2 5 0 3 C = . 2 1 6 7 3 4 2 1
Travelling Salesman Problem (TSP) There are n cities t1,...,tn. Given distances dij from any city ti to any other city tj, we wish to find a shortest total distance tour that starts at city t1, visits all cities (in some order) and returns to t1. Example (an instance):
0 2 3 2 2 0 1 3 C = . 2 1 0 7 3 4 2 0
The parameter n for both AP and TSP is the size of the problem. Algorithms for most optimisation problem are non-trivial and cannot be performed by hand even for relatively small sizes of a problem. Hence computers have to be used. One possibility to predict that a certain computer code C to solve a certain problem P can handle all instances of P of size, say, n = 100 within a CPU hour is to carry out computational experiments for various instances of P of size 100. However, even if we have carried out computational experiments with 2000 instances of P and C solved each of them with a CPU hour, it does not mean C will spend less than one hour for the 2001st instance. To predict the running time of algorithms and of the corresponding computer codes, researchers and practitioners compute the number of elementary operations required by a given algorithm to solve any instance of a certain problem (depending on the instance size). Elementary operations are arithmetic operations, logic operations, shift, etc. Examples: 1.3. OPTIMALITY AND PRACTICALITY 4
In most cases, we are interested in knowing how the number of performed operations depends on n asymptotically. For example, there is an algorithm AAP for the AP that requires at most O(n3) operations. This means that the number of operations is at most 3 cn , where c is a constant not depending on n. For the TSP there is an algorithm ATSP that requires at most O(2n) operations. To sort n different integers whose values are between 1 and n there is an algorithm ABS (basket sort) that requires at most O(n) operations. We may draw some conclusions on the three algorithms without carrying out any computational experiments. For simplicity, assume that the constant c in each of the algorithms equals 10 and every operation takes 10−6 sec to perform. Then for n = 20, −5 ABS will take at most 2 10 sec, AAP 0.08 sec and ATSP 10 sec. For n = 40, ABS will −5 × take at most 4 10 sec, AAP 0.64 sec and ATSP 127 days. For n = 60, ABS will take −×5 at most 6 10 sec, AAP 2.16 sec and ATSP 366000 years. × Already this example indicates that while ABS and AAP can be used for moderate sizes, ATSP may quickly become unusable. In fact, this example shows the difference between polynomial time and exponential time algorithms. Clearly, polynomial time algorithms are ”good” and exponential are ”bad”. Unfortunately, for many optimisation problems, called NP-hard problems, polynomial time algorithms are unknown. Many 1000s of NP- hard problems are polynomially equivalent in the sense that if one of them admits a polynomial time algorithm then so does every other one. Many researchers have tried to find polynomial algorithms for various NP-hard problems, but failed. Thus, we believe that NP-hard problem cannot have polynomial time algorithms. Since TSP is NP-hard, it is very likely there does not exist a polynomial time algorithm for TSP.
1.3 Optimality and practicality
Many people with a mathematical education are trained to search for exact solutions to problems. If we are solving a quadratic equation, there is a formula for the exact solution. If a list of names needs to be sorted, we use an algorithm which produces a perfectly ordered list. Especially concerning mathematical theorems and their proofs, a respect for truth and perfection has evolved historically, and a nearly correct but incomplete or slightly flawed proof is considered of little or no value at all. Therefore the idea of solving a problem and not giving the ”right” answer looks disappointing and disturbing. Yet there are justifiable reasons for accepting computational results that are imperfect or suboptimal. First of all, models created by analysts are not perfect representations of real systems. So even if we could obtain exact solutions to the models they would not necessarily consti- tute exact solutions or perfect managerial advice to be applied for the real systems. Hence, costly efforts to achieve perfect solutions to mathematical models may not be warranted. 1.3. OPTIMALITY AND PRACTICALITY 5
Every computer has only finite many digits to represent a number. Therefore some numbers should be rounded off. Further calculations with such numbers produce accumu- lated error. Often these errors may lead us far away from an optimal solution even if the algorithm is exact. As we saw above many optimisation problems are NP-hard and do not admit polyno- mial time algorithms. Hence we cannot solve those problems to optimality even when the sizes of their instances are moderate. However many NP-hard problems are practically important. Even polynomial time algorithms may be impractical. Indeed, algorithms of running time O(n3) become impractical for values of n exceeding a few thousands. Therefore we cannot and should not solve all problems to optimality. In practice, more often than not researchers and practitioners settle for suboptimal rather than optimal solutions. Hence, in this course we will consider both exact and approximate methods and ap- proaches in computational optimisation. Question: Assume that every operation takes 10−6 sec to perform. We have two al- gorithms to solve a certain problem, one with running time at most 10n5, the other of 10 2n. Which of the two algorithms is faster for n = 20, n = 40 ? Which conclusion can × one draw? Chapter 2
Introduction to Linear Programming
2.1 Linear programming (LP) model
An optimisation problem is called an LP problem (or an instance of LP) if both objective function and constraints are linear. For example,
maximize 2x1 + 3x2 subject to 3x 5x 7 1 − 2 ≤ 4x x = 3 1 − 2 x 0 2 ≥ is an LP problem.
In general, the objective function is of the form c x +c x + +cnxn, a linear function 1 1 2 2 · · · of the decision variables xi with coefficients ci, which is to be minimized or maximized. All constraints are of the form a x + a x + + anxn = ( , )b. 1 1 2 2 · · · ≤ ≥
2.2 Formulating problems as LP problems
Example 2.2.1. (W.L. Winston) An American company manufactures luxury cars and trucks. The company believes that its most likely customers are high-income women and men. To reach these groups the company has embarked on an ambitious TV advertis- ing campaign and has decided to purchase one minute commercial spots on two types of programmes: comedy shows and football games. Each comedy commercial is seen by 7
6 2.2. FORMULATING PROBLEMS AS LP PROBLEMS 7 million high-income women and 2 million high-income men. Each football commercial is seen by 2 million high-income women and 12 million high-income men. One minute comedy advert costs $ 50000 and 1 minute football advert costs $ 100000. The company would like the commercials to be seen by at least 28 million high-income women and 24 million high-income men. Write down an LP model of this problem.
Solution: The company must decide how many comedy and football adverts should be purchased so the decision variables are: x1 =number of one minute comedy adverts, x2 =number of 1 minute football adverts. The company wants to minimise total advertis- ing cost (in thousands of dollars). Total advertising cost = cost of comedy adverts + cost of football adverts = 50x1 + 100x2. Thus, the company’s objective function is
min z = 50x1 + 100x2. The company faces the following constraints:
Constraint 1 Commercials must reach at least 28 million high-income women. Constraint 2 Commercials must reach at least 24 million high-income men.
Constraint 1 may be expressed as 7x +2x 28 and Constraint 2 may be expressed as 1 2 ≥ 2x + 12x 24. The sign restrictions x 0 and x 0 are necessary, so the company’s 1 2 ≥ 1 ≥ 2 ≥ model is given by:
min z = 50x1 + 100x2 s.t. 7x + 2x 28 1 2 ≥ 2x + 12x 24 1 2 ≥ x ,x 0. 1 2 ≥ Example 2.2.2. (W.L. Winston) An auto company manufactures cars and trucks. Each vehicle must be processed in the paint shop and body assembly shop. If the paint shop were only painting trucks, 40 per day could be painted. If the paint shop were only painting cars, 60 per day could be painted. If the body shop were only producing cars it could process 50 per day. If the body shop were only producing trucks, it could process 50 per day. Each truck contributes $300 to profit and each car contributes $200 to profit. Write down an LP model of this problem.
Solution: The company must decide how many cars and trucks should be produced daily. This leads us to define the following decision variables: x1 = number of trucks produced daily, x2 = number of cars produced daily. The company’s daily profit (in hundreds of dollars) is 3x1 + 2x2, so the company’s objective function may be written as:
max z = 3x1 + 2x2. 2.2. FORMULATING PROBLEMS AS LP PROBLEMS 8
The company’s two constraints are the following:
Constraint 1 The fraction of the day during which the paint shop is busy is less than or equal to 1.
Constraint 2 The fraction of the day during which the body shop is busy is less than or equal to 1.
We have 1 Fraction of day paint shop works on trucks = 40 x1 1 Fraction of day paint shop works on cars = 60 x2 1 Fraction of day body shop works on trucks = 50 x1 1 Fraction of day body shop works on cars = 50 x2 Thus, Constraint 1 may be expressed by 1 1 x + x 1 40 1 60 2 ≤ and Constraint 2 may be expressed by 1 1 x + x 1. 50 1 50 2 ≤ Since x 0 and x 0 must hold, the relevant model is 1 ≥ 2 ≥
max z = 3x1 + 2x2 s.t. 1 x + 1 x 1 40 1 60 2 ≤ 1 x + 1 x 1 50 1 50 2 ≤ x ,x 0. 1 2 ≥ Example 2.2.3. (W.L. Winston) You have decided to enter the candy business. You are considering producing two types of candies: Slugger Candy and Easy Out Candy, both of which consist solely of sugar, nuts, and chocolate. At present, you have in stock 100 oz of sugar, 20 oz of nuts, and 30 oz of chocolate. The mixture used to make Easy Out Candy must contain at least 20 % nuts. The mixture used to make Slugger Candy must contain at least 10 % nuts and 10 % chocolate. Each ounce of Easy Out Candy can be sold for 25p, and each ounce of Slugger Candy for 20p. Formulate an LP model that will enable you to maximize you revenue from candy sales.
Solution: (Fill in the details yourself) 2.3. GRAPHICAL SOLUTION OF LP PROBLEMS 9
The LP model is
max z = 25x1 + 20x2 s.t. x + x 150(= 100 + 20 + 30) 1 2 ≤ 0.2x + 0.1x 20 1 2 ≤ 0.1x 30 2 ≤ x ,x 0. 1 2 ≥ Example 2.2.4. (M.W. Carter and C.C. Price) A dual-processor computing facility is to be dedicated to administrative and academic application jobs for at least 10 hours each day. Administrative jobs require 2 seconds of CPU time on processor 1 and 6 seconds on processor 2, while academic jobs require 5 seconds on processor 1 and 3 seconds on processor 2. A scheduler must choose how many of each type of job (administrative and academic) to execute, in such a way as to minimize the amount of time that the system is occupied with these jobs. The system is considered to be occupied even if one processor is idle. (Assume that the sequencing of the jobs on each processor is not an issue here, just the selection of how many of each type of job.)
Solution: Let x1 and x2 denote respectively the number of administrative and aca- demic jobs selected for execution on the dual-processor system. Because policies require that each processor be available for at least 10 hours, we have the following two con- straints: 2x + 5x 10 3600, 6x + 3x 10 3600 and x 0 and x 0. The 1 2 ≥ × 1 2 ≥ × 1 ≥ 2 ≥ system is considered occupied as long as either processor is busy. Therefore, to minimize the completion time for the set of jobs, we must minimize max 2x + 5x , 6x + 3x . { 1 2 1 2} This nonlinear objective can be made linear if we introduce a new variable x3, where x = max 2x + 5x , 6x + 3x 0. 3 { 1 2 1 2}≥ Now if we require x 2x + 5x and x 6x + 3x and make our objective to 3 ≥ 1 2 3 ≥ 1 2 minimize x , we have the desired linear formulation (x ,x ,x 0). 3 1 2 3 ≥
2.3 Graphical solution of LP problems
Example 2.3.1. Graph the set of points 2x + 3x 6, x ,x 0. 1 2 ≤ 1 2 ≥
Solution: See Figure 2.1. We start from drawing 2x1 + 3x2 = 6. To draw this graph we find two points in the x x plane: x = 0,x = 2, x = 0,x = 3. 1 − 2 1 2 2 1 To graph 2x +3x 6, we check whether the point x =0= x belongs to 2x +3x 1 2 ≤ 1 2 1 2 ≤ 6 or not. We see that 2 0 + 3 0 6, so x =0= x does belong to 2x + 3x 6, and × × ≤ 1 2 1 2 ≤ hence the South-West part of the half-plane is the graph of 2x + 3x 6. 1 2 ≤ 2.3. GRAPHICAL SOLUTION OF LP PROBLEMS 10
x2
3
2
1
1 2 3 x1
Figure 2.1: Area for 2x + 3x 6, x ,x 0. 1 2 ≤ 1 2 ≥
Example 2.3.2. Consider the following instance of LP
min z = 50x1 + 100x2 s.t. 7x + 2x 28 1 2 ≥ 2x + 12x 24 1 2 ≥ x ,x 0. 1 2 ≥ Solve the problem graphically.
Solution: See Figure 2.2. The line 7x1 + 2x2 = 28 contains the points x1 = 0,x2 = 14 and x2 = 0,x1 = 4, and the line 2x1 + 12x2 = 24 the points x1 = 0,x2 = 2 and x2 = 0,x1 = 12. The point of intersection of the two lines can be found by solving the system of the two equations which describe them. From the second equation x = 12 6x ; 1 − 2 substituting into the first equation yields 7(12 6x )+ 2x = 28, thus 56 40x = 0. As a − 2 2 − 2 result we get x = 1.4 and x = 12 6 1.4 = 3.6. The graph of the four constraints, that 2 1 − × is, the set of points which satisfy all the constraints, is the entire (infinite) North-East area of Figure 2.2.
The objective function lines are 50x1 + 100x2 = const. It is easy to see that const decreases as the line moves towards the South-West corner. Thus the minimum is achieved at x = 3.6,x = 1.4. The optimal value is z = 50 3.6 + 100 1.4 = 320. 1 2 × × Example 2.3.3. Add the constraint x + x 2 to Example 2.3.2. Investigate the new 1 2 ≤ LP problem. 2.3. GRAPHICAL SOLUTION OF LP PROBLEMS 11
x2 14
2 1
1 2 4 12 x1
Figure 2.2: Figure for Example 2.3.2
Solution: We see that no point satisfies the 5 constraints (see Figure 2.3). So, the LP problem has no feasible solution.
Example 2.3.4. Consider Example 2.3.2, but with the objective to maximize rather than minimize.
Solution: For any const > 320 there are feasible points satisfying 50x1 + 100x2 = const. Thus, the new LP problem is unbounded.
Example 2.3.5. Consider Example 2.3.2, but with objective function min z = x1 + 6x2.
Solution: We see that one optimal solution is still x1 = 3.6,x2 = 1.4, but there are infinitely many optimal points (an entire straight line segment). See Figure 2.4. Conclusions There are four possibilities for an LP problem:
The LP problem has a unique optimal solution. • The LP problem has infinitely many optimal solutions. • The LP problem has no feasible solutions. • The LP problem is unbounded. • 2.3. GRAPHICAL SOLUTION OF LP PROBLEMS 12
x2 14
2 1
12 4 12 x1
Figure 2.3: Figure for Example 2.3.3
x2 14
2 1
1 2 4 12 x1
Figure 2.4: Figure for Example 2.3.5 2.4. QUESTIONS 13 2.4 Questions
Question 2.4.1. (W.L. Winston) Leary Chemicals manufactures three chemicals: A, B, and C. These chemicals are produced via two production processes: 1 and 2. Running Process 1 for an hour costs $4 and yields 3 units of A, 1 of B, and 1 of C. Running Process 2 for an hour costs $1 and produces 1 unit of A and 1 of B. To meet customer demands, at least 10 units of A, 5 of B, and 3 of C must be produced daily. Write down an LP model to minimize the cost of meeting Leary Chemical’s daily demands.
Question 2.4.2. A small toy company manufactures two types of wooden toys: cars and trains. Each car sells for $25 and uses $20 of raw material and labour. Each train sells for $30 and uses $24 of raw material and labour. The manufacture of both types of toys requires two types of skilled labour: carpentry and finishing. A car requires 2 hours of carpentry labour and 3 hours of finishing labour. A train requires 3 hours of carpentry labour and 4 hours of finishing labour. Each week the company can get all needed material, but only 150 finishing hours and 100 carpentry hours. The company has already orders on 20 trains, but expects to sell all manufactured toys. The company wants to decide what number of cars and trains to manufacture in order to maximize its profit. Write down an LP model to maximize the toy company profit.
Question 2.4.3. A television manufacturing company has to decide on the number of 27- and 20-inch sets to be produced at one of its factories. Market research indicates that at most 40 of the 27-inch sets and 10 of the 20-inch sets can be sold per month. The maximum number of work hours available is 500 per month. A 27-inch set requires 20 work hours, and a 20-inch set requires 10 work hours. Each 27-inch set sold produces a profit of £120, and each 20-inch set produces a profit of £80. A wholesaler has agreed to purchase all the television sets produced if the numbers do not exceed the maxima indicated by the market research. (a) Formulate a linear programming model for this problem. (b) Solve this model graphically.
Question 2.4.4. Goldilocks needs to find at least 16 lb of gold and at least 18 lb of silver to pay the monthly rent. There are two mines in which Goldilocks can find gold and silver. Each day that Goldilocks spends in mine 1, she finds 2 lb of gold and 2 lb of silver. Each day that Goldilocks spends in mine 2, she finds 1 lb of gold and 3 lb of silver. Formulate an LP to help Goldilocks meet her requirements while spending as little time as possible in the mines. Graphically solve the LP.
Question 2.4.5. Find out which of the four possibilities this LP problem belongs to.
max z = x1 + x2 2.4. QUESTIONS 14
s.t. x + x 4 1 2 ≤ x x 5 1 − 2 ≥ x ,x 0. 1 2 ≥ Justify your answer. Question 2.4.6. Find out which of the four possibilities this LP problem belongs to.
max z = 4x1 + x2 s.t. 8x + 2x 16 1 2 ≤ 5x + 2x 12 1 2 ≤ x ,x 0. 1 2 ≥ Justify your answer. Question 2.4.7. Find out which of the four possibilities this LP problem belongs to.
max z = x + 3x − 1 2 s.t. x x 4 1 − 2 ≤ 5x + 2x 4 1 2 ≥ x ,x 0. 1 2 ≥ Justify your answer. Question 2.4.8. A computer manufacturing company has to decide on the number of 64-processor and 32-processor computers to be assembled at one of its factories. Market research indicates that at most 20 of the 64-processor computers and 30 of the 32-processor computers can be sold per month. The maximum number of work hours available is 5100 per month. A 64-processor computer requires 200 work hours, and a 32-processor computer requires 100 work hours. Each 64-processor computer sold produces a profit of £9000, and each 32-processor computer produces a profit of £6000. A wholesaler has agreed to purchase all the computers assembled if the numbers do not exceed the maxima indicated by the market research. Write down a linear programming model to maximize the computer company profit. Why may a linear programming model not be adequate for the above problem? Question 2.4.9. Solve the following LP problem graphically:
max z = 25x1 + 50x2 s.t. 7x + 2x 28 1 2 ≤ 2x + 12x 24 1 2 ≤ x ,x 0. 1 2 ≥ Chapter 3
Simplex Method
3.1 Standard Form
In preparation for using the Simplex Method, it is necessary to express the linear program- ming problem in standard form. For a LP problem with n variables and m constraints the standard form is
max z = c1x1 + c2x2 + . . . + cnxn
s.t. a11x1 + a12x2 + . . . + a1nxn = b1
a21x1 + a22x2 + . . . + a2nxn = b2 ......
am1x1 + am2x2 + . . . + amnxn = bm
x ,x ,...,xn 0, 1 2 ≥
where the constants b1,...,bm are non-negative. Often the standard form is written in vector-matrix form:
max z = cx s.t. Ax = b x 0, ≥ 15 3.1. STANDARD FORM 16 where c = (c1,...,cn),
x1 b1 a11 a12 ... a1n x2 b2 a21 a22 ... a2n x = . . . , b = . . . , A = ...... . . . . . . . ...... xn bm am1 am2 ... amn
Although this standard form is required by the Simplex Method, it is not necessar- ily the form that arises naturally when we first formulate our LP model. Thus, some transformations are required to translate the initial form into the standard form. To convert a minimization problem into a maximization problem, we can simply mul- tiply the objective function by 1 and replace min by max. For example, the problem of − minimizing z = 2x 3x is equivalent to that of maximizing z = 2x + 3x . 1 − 2 − 1 2 Equality constraints require no modification. Less-than-or-equal-to ( ) inequalities ≤ require introduction of slack variables. For example, 2x +5x 7 becomes 2x +5x +s = 1 2 ≤ 1 2 1 7. Greater-than-or-equal-to ( ) inequalities are modified by introducing surplus variables. ≥ For example, 4x 6x 8 becomes 4x 6x s = 8. 1 − 2 ≥ 1 − 2 − 2 Finally, the LP standard form requires that every variable is non-negative. If some variable, say x3, is not required to be non-negative in the initial formulation, then we modify it as follows: we replace x3, in each constraint and the objective function, by x′ x′′ and add x′ ,x′′ 0. 3 − 3 3 3 ≥ Example 3.1.1. Transform the following LP problem into standard form.
min z = 50x + 100x − 1 2 s.t. 7x + 2x 28 1 2 ≥ 2x + 12x 24 1 2 ≤ x ,x 0. 1 2 ≥ Solution: We have
max z′ = 50x 100x 1 − 2 s.t. 7x + 2x s = 28 1 2 − 1 2x1 + 12x2 + s2 = 24 x ,x ,s ,s 0. 1 2 1 2 ≥ Example 3.1.2. Transform the following LP problem into standard form.
max z = 50x 10x 1 − 2 3.2. SOLUTIONS OF LINEAR SYSTEMS 17
s.t. x + 2x 28 1 2 ≤ 2x + 15x 24 1 2 ≥ x 0. 2 ≥
Solution: We have
max z = 50x′ 50x′′ 10x 1 − 1 − 2 s.t. x′ x′′ + 2x + s = 28 1 − 1 2 1 2x′ 2x′′ + 15x s = 24 1 − 1 2 − 2 x′ ,x′′,x ,s ,s 0. 1 1 2 1 2 ≥
3.2 Solutions of Linear Systems
Consider a system of independent linear equations, Ax = b, consisting of m equations and n unknowns xi. The n unknowns include the original decision variables and any other variables that may have been introduced in order to achieve standard form. If a system of equations is independent, then m n. If m = n and detA = 0, then − ≤ 6 there is a unique solution x = A 1b. Optimization is not an issue here. ¿From now on, suppose that m