410 likes | 507 Views
Corso MAE Metodi Quantitativi per il Management Quantitative methods for Management. Prof. Gianni Di Pillo Prof. Laura Palagi Dipartimento di Informatica e Sistemistica Universita` di Roma “La Sapienza”. Roma, 18 settembre - 24 ottobre 2003. x 1 , x 2 R. CH, PI R.
E N D
Corso MAE Metodi Quantitativi per il Management Quantitative methods for Management Prof. Gianni Di Pillo Prof. Laura Palagi Dipartimento di Informatica e Sistemistica Universita` di Roma “La Sapienza” Roma, 18 settembre - 24 ottobre 2003
x1 , x2 R CH, PIR Decision variables Objective function max 4 x1+4,5 x2 profit x1+ 1,5 x2 budget constraints x1+ x2 hours x1 , x2 Mathematical model of the production problem LINEAR PROGRAMMING (LP)
Linear Programming (LP) Both objective function and constraints are linearexpressions Proportionality When the level of ony activity is multiplied by a constant factor, then any contribution to the objective function or to any of the constraints is multiplied by the same factor Additivity The value of the objective function and of the constraints is the sum of contribution from the various activity Divisibility Both integer and fractional levels of the activities allowed
PI 16 1CH + 1PI = 14 14 12 10 8 F 1CH + 1,5PI = 18 6 4 CH 2 2 4 6 8 10 12 14 16 18 Final feasible region The best value for(CH,PI)*among the feasible ones is (6,8) which corresponds to the profit PTOT= 4 CH + 4,5 PI = 60
Real decision variables c8,d8 data Objective function c6*c8+d6*d8 Cost: c5*c8+d5*d8 Hours: c7*d8+d7*d8 Equation of the Constraints Production problem with Excel Let us consider the Excel table
1 if project i is selected Decision variables xi= i=1,2,3 0 if project i is not selected Objective function max 12 x1+8 x2+7 x3 earnings constraints 8 x1+6 x2+5 x3 budget x1, x2 , x3 Mathematical model for Capital budgeting INTEGER LINEAR PROGRAMMING (ILP)
Integer Linear Programming (ILP) Both objective function and constraints are linearexpressions Proportionality When the level of ony activity is multiplied by a constant factor, then any contribution to the objective function or to any of the constraints is multiplied by the same factor Additivity The value of the objective function and of the constraints is the sum of contribution from the various activity Indivisibility Only integer levels of the activities allowed
data Integer decision variables c7,d7,e7 Objective C5*C7+D5*D7+E5*E7 Constraint C4*C7+D4*D7+E4*E7 Capital Budget with Excel
Solution of mathematical models Graphical solution (of LP) can be applied only when the number of variables is two Real problems has usually more than two variables Computer must be used as a tool to tackle large quantities of data and arithmetic Many standard software exist to solve LP problems of different level of complexity We useExcel Solver (www.frontsys.com) http://www.frontsys.com/
Tools Add-ins Solver Excel: an easy platform to optimization Excel has an optimization toolbox: Solver
Solving PL with Excel In the main menù select Tools (Strumenti) and then Solver (solutore)
Objective function Decision variables Constraints Tipo di problema (max o min) Solving PL with Excel It will appear a dialog window like below Let now fill in
Objective function PTOT = c9 The value can be set easily by clicking the corresponding cell (it puts the address $c$) Setting the objective function
We need to give an initial value (also zero is feasible) = guess Setting the initial guess Cells C8 and D8 contains the value of the variables. At the end of the optimization process they contain the optimal value
Clich Add (Aggiungi) Window of constraints Setting the constraints
English Italian Address of the cell ora constant Address of the cell Constraint can be of the typeA B A Int (integer value) A bin (binary value 0,1) Setting the constraints
Clicking Options (Opzioni)the window of parameters appears We must Assume Linear Model (use simplex method) and non-negative variables (in alternative we can define the additional constraints c8, d8 0). Setting the options
Maximum time allowed to obtain a solution Maximum iterations of the algorithm to obtain a solution It uses an algorithm for linear problems (simplex) More complex models (non linear) Setting the options
Solve LP con Excel We can start optimization Click the button Solve (Risolvi)
Guess initial values have been substituted by the optimal ones Final result with Excel The “algorithmic” solution is the same obtained with the graphical solution
Reducing time Reducing iterations Reducing or increasing tolerance Same solution Changing the options for LP
Change the model Same solution Changing the options for LP In general this is not true
Objective function Solving Capital Budget with Excel
Variables (b6,c6,d6) are 0-1 Solving Capital Budget with Excel
x1x2x3<= 1 x1x2x3>= 0 x1x2x3 int Solving Capital Budget with Excel
italian english Solving Capital Budget with Excel
Reducing time Reducing iterations same solution but the Solver is not able to certify optimality Changing the options for ILP
Increasing Tolerance SOLUTION CHANGES Optimality declared, but it is not true Changing the options for ILP
For LP problems optimality can always be certified For LP problems sub-optimal solutions do not exist For ILP problems optimality is difficult to be certified For ILP problems many sub-optimal solution may exist Is LP behavior different from ILP ?
Each unit of product requires a certain time on each process Another production problem An engineering factory can produce five type of productsPROD1, PROD2, PROD3, PROD4, PROD5 Two production process must be used: grinding and drilling The factory has 3 grinding machines and 2 drilling machines that works a 6-day week with 2 shifts of 8 hours each day
After deducing raw material costs, each unit of product yields the following profit How much to make of each product so to maximize the total profit ? Objective function Another production problem Final assembly of each unit of product uses 20 hours of a workman’s time 8 man are employed in assembly each working one shift a day
Hours assembly for unit Mathematical model The five type of products are the decision variables PROD1 = x1, PROD2 = x2, PROD3 = x3, PROD4 = x4, PROD5 = x5 x1 , x2, x3, x4, x5 >= 0 Objective function is the profit to be maximize max (2.5x1 + 6 x2 + 3.5 x3 + 4 x4 + 2 x5 )*100 Constraints: Only 8 man * 1 shift * 6 days for assembly 20x1 + 20 x2 + 20 x3 + 20 x4 + 20 x5 <= 384
Mathematical model (2) Constraints: Technological constraints Grinding process Only 3 machines * 2 shift * 6 days 12x1 + 20 x2 + 25 x4 + 15 x5 <= 288 Drilling process Only 2 machines * 2 shift * 6 days 10x1 + 8 x2 + 16 x3 <= 192
20 x1 + 20 x2 + 20 x3 + 20 x4 + 20 x5 12 x1 + 20 x2 + 25 x4 + 15 x5 10 x1 + 8 x2 + 16 x3 x1 , x2, x3 , x4, x5 Mathematical model (3) max2.5 x1 + 6 x2 + 3.5 x3 + 4 x4 + 2 x5 x1 , x2, x3 , x4, x5 integer
384=8 men * 8 hours *6days 288= 3 machines * 16 hours * 6days 192= 2 machines * 16 hours * 6days Production problem with Excel data
Objective function constraints (Real) decision variables Model LP con Excel
Fractional solution Solve LP con Excel We need to insert the integer constraint
We can approximate the fraction solution to an integer value Approximating the solution Is the optimal solution ?
constraints Integer decision variables Model ILP con Excel
Integer solution Solve ILP con Excel The solution obtained is better than the “approximating one”