# Corso MAE Metodi Quantitativi per il Management Quantitative methods for Management Roma, 18 settembre - 24 ottobre 2003 Prof. Gianni Di Pillo Prof. Laura.

## Presentation on theme: "Corso MAE Metodi Quantitativi per il Management Quantitative methods for Management Roma, 18 settembre - 24 ottobre 2003 Prof. Gianni Di Pillo Prof. Laura."— Presentation transcript:

Corso MAE Metodi Quantitativi per il Management Quantitative methods for Management Roma, 18 settembre - 24 ottobre 2003 Prof. Gianni Di Pillo Prof. Laura Palagi Dipartimento di Informatica e Sistemistica Universita` di Roma “La Sapienza”

Mathematical model of the production problem Objective function 4 x 1 +4,5 x 2 max profit Decision variables CH, PI  R x 1, x 2  R constraints x 1 + 1,5 x 2 budget x 1 + x 2 hours x 1, x 2 LINEAR PROGRAMMING (LP)

Linear Programming (LP) Both objective function and constraints are linear expressions 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

Final feasible region The best value for (CH,PI)* among the feasible ones is (6,8) which corresponds to the profit P TOT= 4  CH + 4,5  PI = 60 1  CH + 1,5  PI = 18 CH PI 14 12 2 4 6 8 10 16 14246810121618 1  CH + 1  PI = 14 F

Production problem with Excel Let us consider the Excel table Objective function c6*c8+d6*d8 Cost: c5*c8+d5*d8 Hours: c7*d8+d7*d8 Equation of the Constraints data Real decision variables c8,d8

Mathematical model for Capital budgeting Objective function 12 x 1 +8 x 2 +7 x 3 max earnings Decision variables xi=xi= 1 if project i is selected 0 if project i is not selected i=1,2,3 constraints 8 x 1 +6 x 2 +5 x 3 budget x 1, x 2, x 3 INTEGER LINEAR PROGRAMMING (ILP)

Integer Linear Programming (ILP) Both objective function and constraints are linear expressions 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

Capital Budget with Excel Objective C5*C7+D5*D7+E5*E 7 Integer decision variables c7,d7,e7 Constraint C4*C7+D4*D7+E4*E7 data

Solution of mathematical models We use Excel Solver (www.frontsys.com) http://www.frontsys.com/ Graphical solution (of LP) can be applied only when the number of variables is two Real problems has usually more than two variables Many standard software exist to solve LP problems of different level of complexity Computer must be used as a tool to tackle large quantities of data and arithmetic

Excel: an easy platform to optimization Excel has an optimization toolbox: Solver Solver Add-ins Tool s

Solving PL with Excel In the main menù select Tools (Strumenti) and then Solver (solutore)

Solving PL with Excel It will appear a dialog window like below Objective function Tipo di problema (max o min) Decision variablesConstraints Let now fill in

Setting the objective function Objective function P TOT = c9 The value can be set easily by clicking the corresponding cell (it puts the address \$c\$)

Setting the initial guess We need to give an initial value (also zero is feasible) = guess Cells C8 and D8 contains the value of the variables. At the end of the optimization process they contain the optimal value

Setting the constraints Clich Add (Aggiungi) Window of constraints

Setting the constraints ItalianEnglish Address of the cell or a constant Address of the cell Constraint can be of the type A    B A Int (integer value) A bin (binary value 0,1)

Setting the options We must Assume Linear Model (use simplex method) and non- negative variables (in alternative we can define the additional constraints c8, d8  0). Clicking Options (Opzioni) the window of parameters appears

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)

Solve LP con Excel We can start optimization Click the button Solve (Risolvi)

Final result with Excel Guess initial values have been substituted by the optimal ones The “algorithmic” solution is the same obtained with the graphical solution

Changing the options for LP Reducing timeReducing iterationsReducing or increasing tolerance Same solution

Changing the options for LP Same solution Change the model In general this is not true

Solving Capital Budget with Excel Objective function

Solving Capital Budget with Excel Variables (b6,c6,d6) are 0-1

Solving Capital Budget with Excel x 1 x 2 x 3 = 0 x 1 x 2 x 3 int

italian english Solving Capital Budget with Excel

Changing the options for ILP Reducing timeReducing 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

Is LP behavior different from 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

Another production problem An engineering factory can produce five type of products PROD1, PROD2, PROD3, PROD4, PROD5 Two production process must be used: grinding and drilling Each unit of product requires a certain time on each process The factory has 3 grinding machines and 2 drilling machines that works a 6-day week with 2 shifts of 8 hours each day

Another production problem Final assembly of each unit of product uses 20 hours of a workman’s time How much to make of each product so to maximize the total profit ? Objective function 8 man are employed in assembly each working one shift a day After deducing raw material costs, each unit of product yields the following profit

Mathematical model The five type of products are the decision variables Objective function is the profit to be maximize PROD1 = x 1, PROD2 = x 2, PROD3 = x 3, PROD4 = x 4, PROD5 = x 5 max (2.5 x 1 + 6 x 2 + 3.5 x 3 + 4 x 4 + 2 x 5 )*100 x 1, x 2, x 3, x 4, x 5 >= 0 Constraints: Only 8 man * 1 shift * 6 days for assembly 20 x 1 + 20 x 2 + 20 x 3 + 20 x 4 + 20 x 5 <= 384 Hours assembly for unit

Mathematical model (2) Constraints: Only 3 machines * 2 shift * 6 days 12 x 1 + 20 x 2 + 25 x 4 + 15 x 5 <= 288 Technological constraints Grinding process Only 2 machines * 2 shift * 6 days 10 x 1 + 8 x 2 + 16 x 3 <= 192 Drilling process

Mathematical model (3) max 2.5 x 1 + 6 x 2 + 3.5 x 3 + 4 x 4 + 2 x 5 20 x 1 + 20 x 2 + 20 x 3 + 20 x 4 + 20 x 5 12 x 1 + 20 x 2 + 25 x 4 + 15 x 5 10 x 1 + 8 x 2 + 16 x 3 x 1, x 2, x 3, x 4, x 5 x 1, x 2, x 3, x 4, x 5 integer

Production problem with Excel 384=8 men * 8 hours *6days 288= 3 machines * 16 hours * 6days 192= 2 machines * 16 hours * 6days data

Model LP con Excel constraints (Real) decision variables Objective function

Solve LP con Excel Fractional solution We need to insert the integer constraint

We can approximate the fraction solution to an integer value Approximating the solution Is the optimal solution ?

Model ILP con Excel constraints Integer decision variables

Solve ILP con Excel Integer solution The solution obtained is better than the “approximating one”

Similar presentations