











































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












































2006:285 CIV
Luleå University of Technology MSc Programmes in Engineering Engineering Physics Department of Mathematics
2006:285 CIV - ISSN: 1402-1617 - ISRN: LTU-EX--06/285--SE
by Per Bergstr¨om
Department of Mathematics
SE-971 87 Lule˚a
Sweden
October 1, 2006
Abstract
This thesis treats an algorithm that solves linear optimization problems. The algorithm is based on a similar idea as the simplex method but in this algorithm the start value also might be an inner point or a boundary point at the feasible region. The start value does not necessarily have to be a corner point that the simplex algorithm demands. The algorithm solves problems in standard form. That means that the constraints are with equality and every variable must be positive. The algorithm operates in the dual space to the original problem. During the progress of the algorithm the iteration points will be on the boundary at the feasible region to the dual problem and finally end up in a corner. Afterwards the iteration values go from corner to corner until finally the optimum is reached, just like the simplex algorithm. The expected time to solve linear optimization problems with this algorithm seems to be polynomial in time with respect to the size of the problem, thought the worst case behavior has not been analyzed. If the last iteration value is just an approximate solution to the dual problem the algorithm will transfer it to a quite good approximation to the primal problem. Much of the development in this thesis is a continuation of a similar algorithm which was done one year ago. In the introduction and in the second chapter different forms of linear optimiza- tion problems are described. The algorithm is implemented in Matlab ©R^ and the code can be find in the appendices of this paper. There are also different versions, which solve different types of problems. One for general problems and one for network flow problems.
Acknowledgments
First of all I would like to thank my supervisor, associate professor Ove Edlund. He has taken his doctor’s degree in scientific computing. A majority part of his doctoral thesis deals with linear programming. The interested reader who wants to read it can find it on the web. There is a link to Ove’s thesis in the references of this thesis, in fact reference number [1]. It was perfect to have a supervisor like Ove when experiment with and writing about linear programming. It is always good to have an experienced supervisor in his own subject when doing research. This thesis has been time consuming. At least it took a long while from start until finish. Before I finished my master thesis I was offered an interesting trainee job. That was a trainee job at the Swedish company Tomlab^1 , which is the world-
wide leading company in optimization solvers for Matlab ©R^ and LabVIEW TM . The company has offices in V¨aster˚as (Sweden) and San Diego (USA, CA), and I was placed in San Diego. It was very exciting to live in another part of the world for a while than northern Sweden where I was born and usually live. The trainee job at Tomlab had no direct connection with this thesis, but the job gave me understanding in how extremely important optimization is for the society today. It also gave me lots of experiences in computer science and last but not least, it gave me knowledge in how it is to work in the industry. However, it was not a hard decision to accept the job offer from Tomlab, even if I was forced to finish this thesis during the lovely Swedish summer.
Lule˚a, October 1, 2006
Per Bergstr¨om
(^1) http://www.tomlab.biz/
List of Tables
Table 2.1. The yearly capacities and requirements in suitable units.... 9 Table 2.2. Unit costs for supplying each customer from each supplier.. 9 Table 2.3. The swimmers personal best expressed in seconds....... 13
Table 5.1. Comparison between two different algorithms. m is the number of equality constraints and t is measured in seconds.......... 26 Table 5.2. Comparison between two different algorithms. m is the number of equality constraints and t is measured in seconds.......... 27 Table 5.3. Results from comparison with problem from simsys sparse. m is the number of equality constraints and t is measured in seconds. 28 Table 5.4. Results from comparison with problem from simsys sparse2. m is the number of equality constraints and t is measured in seconds. 28 Table 5.5. Results from comparison with problem from Netlib. t is mea- sured in seconds.............................. 29
This Master Thesis is a sequel to a D-level thesis that was done one year ago. The result from that was so good, enough to make a continuation possible, a Master thesis, on the same theme. The algorithm in the D-level thesis solves problem in one mathematical form, not a usual form in applied problems. That’s the goal in this thesis, to write the code suited for applied problems. In the beginning of this thesis some applied problems will be described. Two different terms are used, linear programming and linear optimization, but they describe the same thing. First of all, something about linear programming and its history must be men- tioned. For the readers who are not familiar with the subject, it can be said that it all started for about 60 years ago, during World War II. At least, lots of things in the area of subject took shape at that time. Of course, lots of persons were in- volved into developing and improvement of solving linear programming problems, but there is one who has a special influence and has been acknowledged as the founder of the first efficient solving algorithm, the simplex method. His name is George Dantzig. George worked with military planning in Pentagon for the U.S. Air Force during World War II. He was expert in solving planning problems with a desk calculator. It was then it all started. Developing mathematical models were not the only thing he did, he also developed an efficient solver to the problems. The method is called the simplex method. Since that time mathematical planning has been spread to more applications than military planning. In the beginning of the book ”Linear programming and extensions”, which is written by George Dantzig, reference [2], Dantzig gives examples of linear programming problems and also the origins to linear programming models. Today it is an important tool in many industrial applications and financial and economical science. The development of models has led to larger and larger problems. Problems with a size of millions of variables are not unrealistic. See for example reference [3], where the authors describe and solve a problem with millions of variables, and they make use of a linear programming solver. Such large problems will take very long time to solve. With that size of problems it is very important what kind of solving method you are using. It also may bee good idea to make use of a supercomputer. Then it is good to have an algorithm that is efficient to use on a parallel computer. Until the middle of the 80’s the simplex method was with no doubt the leading solver. Then there came new generation solvers called inner point methods. The difference between the inner point methods and the simplex method is that in the simplex method all the iteration points are in corners to the feasible region. In the inner point method all the iteration points are inside the feasible region. For very large problems the simplex method might be very time consuming. That is because of the numbers of corners to the feasible region grow exponential to the size of the problem. However, the inner point method might be unstable because of all the numerical troubles that might occur. So different problems claim different
In applied linear programming the matrix will often be huge and sparse. The sparse pattern arises because of weak relations between all the decision variables. Every variable just has direct connection with a couple of other variables among perhaps thousands of them. A detailed example of this follows in section 2.3. In this chapter examples of linear programming problems from the reality will be described. There is lot of literature where you can find examples of applied linear programming. For example, see [4],[5] or [6]. One of many types of problems is the transportation problem. In [4] Williams gives an example of such a problem. At page 73 you can find the following example.
2.1. Example 1. A Transportation Problem
Three suppliers (S1,S2,S3) are used to provide four customers (T1,T2,T3,T4) with their requirements for a particular commodity over a year. The yearly capacities of the suppliers and requirements of the customers are given in table 2.1 (in suitable units).
Table 2.1. The yearly capacities and requirements in suitable units. Suppliers S1 S2 S Capacities (per year) 135 56 93 Customers T1 T2 T3 T Requirements (per year) 62 83 39 91
The unit costs for supplying each customer from each supplier are given in table 2.2 (in £/unit).
Table 2.2. Unit costs for supplying each customer from each supplier. Customers T1 T2 T3 T S1 132 - 97 103 Suppliers S2 85 91 - - S3 106 89 100 98
A dash indicates the impossibility of certain suppliers for certain depots or cus- tomers. The total capacity of the suppliers is greater than the requirement of the cus- tomers. To get an easier structure in the problem you can introduce a new cus- tomer (it is called a dummy customer) with requirement 9 units per year. With
the new dummy customer the total capacity of the suppliers is equal to the re- quirement of the customers. The problem can be viewed in a graph. Se figure 2.1.
Figure 2.1. Graph for problem in example 1.
This problem can be formulated to a LP model by introducing variables xij to represent the quantity of the commodity sent from Si to Tj in a year. The resultant model is (2.1).
If the dummy customer T5 was not introduced the three first equalities had been inequalities. As you can see the model has a very special structure. Another type of problem is the assignment problem. In [7] the authors give an example of an assignment problem.
2.2. Example 2. Relay swimming race
Before every Olympic Game or big competition the national swimming team man- ager gets the commission to take out the best team in relay swimming 4x100 meter medley. Medley consists of the sections backstroke, butterfly, breaststroke and freestyle. At the Olympic Games in Sidney the national women’s team manager had to choose from among six swimmers. The swimmers personal best is given in table 2.3 expressed in seconds. A dash in the table means that the person couldn’t or didn’t want to swim that section. Determine which team that gives the lowest total time.
Table 2.3. The swimmers personal best expressed in seconds. Name Freestyle Backstroke Breaststroke Butterfly Emma 57.78 - 70.05 - Therese 54.41 62.42 - 60. Johanna 56.62 67.40 - 58. Anna-Karin 57.66 - - 59. Louise K 57.89 66.09 70.73 63. Louise J 55.55 - - 62.
Since there are six swimmers and four sections it makes it easier to introduce two pretending sections which will be assign to those swimmers who will not be selected to the team. The two pretending sections will have a cost of 0. The graph of the problem can be seen in figure 2.2.
2.3. Example of network flow problem
In the two previous sections two examples were described more or less from the reality. Both the problems have a similar structure. A more general problem of this kind is network flow problems. A Matlab-program that generates these kind of problems has been made in this master thesis. When testing LP algorithms it is an advantage to have a problem to solve. Of course you can take examples from literature but it takes lots of time to write it down and these problems are also quite small. In real life these problems are much larger, with perhaps hundreds of thousands variables. To get problems of that size it is impossible to write it down from literature, because of no literature has examples of that size, and if they have, it should take to much time to transfer the problems correctly. One way to evade this is to let a computer program generates test problems. Network flow problems can be shown in a graph. A graph consists of nodes and arcs. Each node is connected with at least one other node by an arc (or many arcs). The graph is connected. That means that it is a connection between all the nodes in one or another way. In the network there are production, consumption and a flow. The production and consumption are at the nodes and the flow is in the arcs. One node is viewed in figure 2.3.
Figure 2.3. Node with net production, inflow and outflow.
At each node there is a total inflow, a total outflow and a net production. Nothing of the flow disappears and therefore must the equation (2.2) hold at each node.
total outflow − total inflow = net production (2.2)
Because of the fact that the graph is connected it is a connection between all the nodes. In the type of problem that is generated here the graph is undirected. That means that the flow can go in both directions between each node. Se figure 2.4.
Figure 2.4. Undirected graph.
In the continuation one undirected arc will be used instead of two directed arcs between the nodes. For every node the equation (2.2) must hold. The flow from node i to node j is denoted by xi,j. Of course, the flow must be greater then zero and the flow might also have an upper limit (unlike the example problems in the previous chapter). Each node has a number of inflows and a number of outflows. Some of them have also a net production different from zero. It is the cost of the total flow through the network you want to minimize. This kind of problem is an LP-problem of the form (2.3).
min x cTx s.t. Ax = b x ≥ 0
The rows in A consist of information from corresponding node. The matrix will have a distinctly sparse pattern. Every column in A consists of one 1 and one −1. The remaining elements are zero. The number of columns in A is the same as the number of arcs in the graph. This is the same as the number of variables in the problem. A quite large problem can be viewed in figure 2.5. This flow problem has 1024 nodes and 5052 arcs.
The node that has a positive net production (the source) is marked with red color. Also the amount of the net production is marked in the graph. In this example there are 10 nodes that have a negative net production (the sinks). The sinks are marked with blue colour and also the amounts of the (negative) net production are marked. The nodes that have zero net production are smaller and black. In this case the cost is proportional with the distance between the nodes. The optimal solution is marked with dark red color. The structure plot of the matrix A to this problem is shown in figure 2.6.
Figure 2.6. Structure plot of A.
The sparse pattern appears distinctly. As mentioned before the number of non- zeros in each column is two. Since there are 1024 rows only about 0.002 of the total elements are nonzero. For larger problems this share will be even smaller. Another version of generated test problems have also been done. The second version generates the same kind of problmes but the graph of this problem will have a little bit different form. The graph and the structure plot can be seen in figure 2.7 and figure 2.8.
Figure 2.
. Graph with optimal solution.