%OP%PL70 %OP%PS1 %OP%TM0 %OP%HM0 %OP%FM0 %OP%BM0 %OP%LM8 %OP%DE8+66+6=80 %CO:A,11,67%PROGRAMME "LINPROG" 15.2.1989 This programme solves the primal and dual problems of the standard linear programming model. See any good business or mathematical book on optimisation theory for further details. In business terms, LP maximises the profit or minimises the cost of an operation (the c's) by computing the optimum level of activities (the x's), subject to a series of material or human constraints (the b's). Cost function : max or min c1.x1+c2.x2+..........+cn.xn Constraints matrix: a11.x1+a12.x2+a13.x3.......+a1n.xn<=,>= or=b1 a21.x1+a22.x2+a23.x3.......+a2n.xn<=,>= or=b2 ............................................. am1.x1+am2.x2+am3.x3.......+amn.xn<=,>= or=bm Normally, the x's >=0, but in this programme some or all may be allowed to move freely over positive and negative values. %H1%Input%H1% First, maximisation or minimisation should be specified. This is followed by the number of constraints m (rows) and by the number of variables n (activities, columns). Then, individual variables can be declared "restricted"(default),i.e.>=0,or "unrestricted", i.e. positive or negative. The cost coefficients, the c's, follow one by one; then the right-hand side constraints, e.g. the type (LE for <=, EQ for =, GE for >=) and the b's. The matrix of the a's must then be filled up in any order and only for the non-zero elements by specifying the corresponding indices. %H1%Output%H1% The optimal value of the cost function is followed by the optimal values of the n variables and the m values of the slacks (difference between the right-hand and left-hand side). With the help of the dual solution, the m "marginal costs" have also been calculated: they show by how much the optimum value would change if the constraining right-hand side(the b's) would individually be increased by one unit. Finally, the dual solution has also been used to calculate the "reduced costs", a value which shows for variables not part of the optimal solution by how much its cost coefficient should be increased to bring it in the optimal solution (everything else being equal) %H1%Notes%H1% In input and output, on the left-hand side of the screen, are shown the matrix indices of the first number on this line; this to help in reading numbers of large or long matrices. In statement 20 of the listing are set the maximum number of rows and colums; these values can of course be changed. At most points, to leave values unchanged or to skip, press the keys 0 or ENTER. A more extensive writeup can be obtained from the author. Author: Bruno Pellaud Santisstrasse 22 8123 Ebmatingen, Switzerland %CO:B,11,56%%CO:C,11,45%%CO:D,11,34%%CO:E,11,23%%CO:F,11,12%