Brincando com a Otimização Linear - ibilce.unesp.br€¦ · valor marginal (custo reduzido)...
Transcript of Brincando com a Otimização Linear - ibilce.unesp.br€¦ · valor marginal (custo reduzido)...
Brincando com a Otimização Linearou “ Lego of my simplex” ( Pendegraft,1997)
Socorro RangelDMAp - IBILCE - UNESP
O Problema
Matéria Prima Disponível6 peças grandes8 peças pequenas
Especificação do produto
cadeira: 1 peça grande2 peças pequenas
mesa: 2 peças grandes 2 peças pequenas
1
Objetivo: Encontrar umacombinação de produtos quedê o maior lucro possível.
Valor: 10 u.m.
Valor: 16 u.m.
Construção do Modelo Matemático Decisão a ser tomada
Quantas cadeiras produzir ===> x1
Quantas mesas produzir ===> x2
2a
x1, x2 variáveis de decisão
Construção do Modelo Matemático Objetivo: Maximizar o lucro total
cadeira:1 10 u.mx1 10 x1 u.m.
mesa:1 16 u.m.x2 16 x2 u.m.
Total: 10 x1 + 16 x22b
Função objetivo:
max Z = 10 x1 + 16 x2
Construção do Modelo Matemático Restrições : Disponibilidade de recursos
peças grandes disponíveis: 61 cadeira 1 peçax1 cadeiras x1 peças
1 mesa 2 peçasx2 mesas 2 x2 peças
Total: x1 + 2 x2 2c
Restrição 1 (peças grandes)
x1 + 2x2 <= 6
Modelo de Otimização Linear max Z = 10 x1 + 16 x2
sujeito ax1 + 2 x2 <= 6
2x1 + 2x2 <= 8x1 , x2 >= 0
2d
O Método Simplex Determine a atividade de maior
valor marginal (custo reduzido) Determine a primeira restrição
que pode ser violada se a atividade acima subir de nível
Troque uma atividade por outra
4
O Método Simplex Problema na forma padrão
max 10 x1 + 16 x2
sujeito ax1 + 2 x2 + x3 = 6
2x1 + 2x2 + x4 = 8x1 , x2, x3, x4 >= 0
4
x3 = quantidade de peças grandes em estoquex4 = quantidade de peças pequenas em estoque
O Método Simplex Solução inicial
( x1 , x2 ) = (0,0)
(x3 , x4 ) = (6, 8)
Solução básica viável
Não há produção de mesas e cadeiras, as peças grandes e pequenas são mantidas em estoque
4
Z = 0
O Método Simplex Determinar valor marginal das
atividades
Z = 10 x1 + 16 x2
Se produzirmos uma cadeira = 10
Se produzirmos uma mesa = 16
Atividade com maior valor marginal: produzir mesas 4
Iteração 1
O Método Simplex Quantas mesas podem ser
produzidas?x3 = 6 - x1 - 2 x2
x4 = 8 - 2x1 - 2 x2
4x2 = min{ 6/2, 8/2} = 3
e ficamos sem peças grandes em estoque : x3 = 0
Iteração 1
O Método Simplex Trocamos a atividade x3 por x2
A nova solução é:
4
( x1 , x3 ) = (0,0)
(x2 , x4 ) = (3, 2)
Solução básica viável
Produzir 3 mesas
Manter 2 peças pequenas em estoque
Lucro associado: 48 u.m.
Iteração 1
Z = 48
O Método Simplex
Determinar valor marginal das atividades
Não temos peças grandes em estoque
Para construir uma cadeira será necessário usar metade de uma mesa (mais uma peça do estoque):
10 - 16(1/2) = 2
4
Iteração 2
Z = 48 + 2 x1 - 8 x3
O Método Simplex Quantas cadeiras podem ser
produzidas?x2 = 3 - (1/2) x1 - (1/2) x3
x4 = 2 - x1 + x3
4x1 = min{ 3/(1/2), 2/1} = 2
e ficamos sem peças pequenas em estoque : x4 = 0
Iteração 2
O Método Simplex Trocamos a atividade x4 por x1
A nova solução é:
4
( x4 , x3 ) = (0,0)
(x2 , x1 ) = (2, 2)
Solução básica viável
Produzir 2 mesas
Produzir 2 cadeiras
Lucro associado: 52 u.m.
Iteração 2
Z = 52
O Método Simplex
Determinar valor marginal das atividades Não temos peças em estoque
Para obter peças suficientes para construir uma cadeira será necessário desmanchar totalmente uma mesa:
10 - 16 = - 6
De maneira similar precisamos desmanchar uma cadeira, mas obtemos apenas metade de uma mesa.
- 10 + 16(1/2) = - 2
4
Iteração 3
Z = 52 - 6 x3 - 2 x4
Análise de Sensibilidade Quanto vocês pagariam por
uma peça grande extra?
Quantas peças grandes vocês comprariam?
Quantas peças grandes vocês venderiam? 5
Análise de Sensibilidade Quanto vocês pagariam por
uma peça grande extra? Desmanchamos uma cadeira Construímos uma mesa
16 - 10 = 6
5O valor a ser pago por uma peça grande extra é : 6 u.m.
Nova solução:
1 cadeira e 3 mesas
Lucro:
1(10) + 3 (16 ) = 58 - 6 = 52
Análise de Sensibilidade Quantas peças grandes vocês
comprariam? Temos apenas duas cadeiras
que podem ser desmanchadas para construir novas mesas.
Compraríamos no máximo 2 peças grandes. 5
Nova solução:
4 mesas
Lucro:
4 (16 ) - 2(6) = 64 - 12 = 52
Análise de Sensibilidade Quantas peças grandes vocês
venderiam? Se desmancharmos uma
mesa, podemos construir uma cadeira e vender uma peça grande.
Se desmancharmos duas mesas, podemos construir 4 cadeiras e vender duas peças grandes.
5
Nova solução:
4 cadeiras
Lucro:
4 (10 ) = 40 + 2(6) = 52
Análise de Sensibilidade Temos que o número de peças
grandes pode variar de mais ou menos dois sem que
o lucro (base ótima)
se altere.5
O problema dual Determinar o menor preço a
ser pago pelos recursos disponíveis
6u1 + 2 u2 >= 10
2 u1 + 2u2 >= 16u1 , u2 >= 0
Min 6u1 + 8u2
sujeito a
O problema dual
6a
u1 + 2 u2 >= 10
2 u1 + 2u2 >= 16u1 , u2 >= 0
min D = 6u1 + 8u2
sujeito a
O problema primal max Z = 10 x1 + 16 x2
sujeito ax1 + 2 x2 <= 6
2x1 + 2x2 <= 8x1 , x2 >= 0
Para Saber Mais Pendergraft, N. “ Lego of my
simplex”, ORMS Today, v. 24, n. 1, 1997.
Boletim da SOBRAPO, informe 16, abr-mai, 1997.
Tunala, N., “ Um procedimento Geométrico para a otimização linear no plano”, Revista do Professor de Matemática, n. 31, 1996.
7
Construcao de Modelos de Otimização
Rangel, S. “Introdução à construção de modelos de otimização linear e inteira”. 1. ed. São Carlos-SP: Sociedade Brasileira de Matemática Aplicada e Computacional-SBMAC, 2012. v. único. 82 p. 2ª Edição(disponível em http://www.sbmac.org.br/arquivos/notas/livro_18.pdf )
WILLIAMS, H.P. –Model Bulding in Mathematical Programming, John Wiley & Sons, 1990.
GOLDBARG, M.C e HPL Luna, Otimização Combinatória e Programação Linear, Editora Campus, 2000.
Wagner, H. M.Pesquisa OperacionalEd. Prentice Hall do Brasil (1986)
7
Solução de Modelos
ARENALES, et al. “Pesquisa Operacional”, Elsevier, 2006.
GOLDBARG, M.C e HPL Luna, Otimização Combinatória e Programação Linear, Editora Campus, 2000.
BAZARAA, M.J. e JARVIS, J.J. -Linear Programming and Network Flows, 1993, 2ª edição.J. Wiley & Sons, N.Y.
Luemberger, David - Linear and Non Linear ProgrammingAddison Wesley (1984)
Maculan, N. - Programação Linear InteiraCOPPE-UFRJ (1978)
Wagner, H. M. - Pesquisa OperacionalEd. Prentice Hall do Brasil (1986) 7
February 1997 € Volume 24 € Number 1
By Norman Pendegraft
In an article in OR/MS Today [1993], Robert Bosch described anexercise for an introductory management science course in which herequires the students to create a low-cost nutritionally complete dietfrom McDonalds.
I have used this exercise and find it extremely effective indemonstrating some of the difficulties of solving real problems. Sincemany students find that concrete examples help them to understandabstract ideas, I have developed an in-class exercise using the popularchildren's toy, Legos™, to illustrate the economics of linearprogramming during a one-hour lecture.
The class divides into small groups, and each group is given a bagcontaining eight small Legos and six large Legos. I demonstrate theconstruction of a table and a chair (see Figure 1).
Figure 1
Prices for tables and chairs are announced ($16 and $10 in the currentexample), and the class is asked to select a product mix to maximizetheir profits using the available resources. After a few minutes, mostteams have found the optimal mix &endash; two tables and two chairs(see Figure 2). Some have stopped with a suboptimal solution of threetables.
Figure 2: The Initial Solution
OR/MS Today - February 1997 - Issues In Education http://www.orms-today.org/orms-2-97/legomysimplex.html
1 of 3 07/05/2015 16:57
The simplex method involves a three-step search procedure: find theactivity with the highest marginal value, find the tightest constraint,substitute one activity for another. If we start with a solution of zerochairs and zero tables (see Figure 3) and then employ this procedure,we will find a solution of three tables with a profit of $48. The secondsimplex table shows that chairs now have a marginal value of $2 ratherthan their initial $10. Why should this be so?
Figure 3: The Optimal Solution
Explaining why the marginal values of the activities change and themechanics of the substitution is always hard at the blackboard, butwhen the students have three tables in hand, they can easily see thatin order to make any chairs, they must first take apart a table in orderto get the needed resources. To make a chair, they must give up half atable, which gives chairs a marginal value of $10-(1/2)=$2.
When they reach the next extreme point, they can see that while theycan make more chairs, the exchange rate changes; because they arenow out of small Legos, they must now give up one table for eachchair. This means that the marginal values change, or that anotherpivot is needed.
They also see why this point is optimal: the value of the table given up($16) exceeds the value of the new chair ($10). Now that we have anoptimal solution, we can explore the sensitivity of this solution tochanges in the amounts of available resources. I hold aloft anotherlarge Lego and ask what I am bid for the extra resource. Some willimmediately bid $16 because they recognize that they can use it tomake a new table. Then they realize that they must give up a chair todo so, and find the correct marginal value, $6.
When I ask how many they would buy at that price they can quicklysee by disassembling their own tables and chairs that there is no valueto more than two large ones; i.e. the allowable increase is two.Similarly, they find that the allowable decrease is two. Later when wework through this calculation, we refer back to the class exercise.Student response to the exercise has been extremely favorable.
Reference
1. Bosch, Robert A., 1993, "Big Mac Attack," OR/MS Today, August,pp.30-31.
Norman Pendegraft is a professor at the College of Business andEconomics at the University of Idaho , Moscow, Idaho.
OR/MS Today - February 1997 - Issues In Education http://www.orms-today.org/orms-2-97/legomysimplex.html
2 of 3 07/05/2015 16:57
E-mail to the Editorial Department of OR/MS Today: [email protected]
OR/MS Today copyright © 1997, 1998 by the Institute for Operations Researchand the Management Sciences. All rights reserved.
Lionheart Publishing, Inc.2555 Cumberland Parkway, Suite 299, Atlanta, GA 30339 USAPhone: 770-431-0867 | Fax: 770-432-6969E-mail: [email protected]
Web Site © Copyright 1997, 1998 by Lionheart Publishing, Inc. All rightsreserved.Web Design by Premier Web Designs, e-mail [email protected]
OR/MS Today - February 1997 - Issues In Education http://www.orms-today.org/orms-2-97/legomysimplex.html
3 of 3 07/05/2015 16:57