SlideShare uma empresa Scribd logo
Programa¸˜o Linear
               ca

       Alexandre Salles da Cunha


       DCC-UFMG, Mar¸o 2010
                    c




Alexandre Salles da Cunha   Programa¸˜o Linear
                                    ca
Vamos considerar o seguinte problema
Pedro deseja saber conhecer o m´ ınimo or¸amento que precisa gastar
                                         c
diariamente para satisfazer suas necessidades di´rias de nutrientes, a
                                                a
saber:
     Prote´ınas: 55 g
     C´lcio: 800 mg
       a
     Energia: 2000 Kcal.
Para obter estas fontes de nutrientes, Pedro disp˜e dos seguintes
                                                  o
alimentos:
   Alimento      Tamanho da           Energia      Proteina         C´lcio
                                                                     a        Pre¸o da
                                                                                 c
                   por¸˜o
                      ca               (kcal)        (g)            (mg)       por¸˜o
                                                                                  ca
                                                                             (centavos)
    Cereais          28 g                110           4               2         3
    Frango          100 g                205           32             12         24
     Ovos         2 grandes              160           13             54         13
     Leite         237 cc                160           8             285         9
  Carne porco       260 g                260           14             80         19
                   Alexandre Salles da Cunha   Programa¸˜o Linear
                                                       ca
O problema a resolver



Dentre todas as dietas (combina¸˜es de alimentos) que garantam a
                               co
satisfa¸˜o da ingest˜o m´
       ca           a   ınima de nutrientes, apresente uma cujo custo
seja m´ınimo.

    Identificar uma estrutura linear entre o custo e a satisfa¸ao das
                                                             c˜
    necessidades nutricionais com a ingest˜o de nutrientes.
                                           a
    Formular um Problema de Otimiza¸˜o adequado.
                                   ca
    Resolver o Problema.




                   Alexandre Salles da Cunha   Programa¸˜o Linear
                                                       ca
Formulando o problema



Separando os dados do problema dos valores atribu´
                                                 ıdos ` instˆncia do
                                                      a     a
problema.
    Conjunto de nutrientes a satisfazer: I .
    Necessidade di´ria de cada nutriente: {di : ∀i ∈ I }
                  a
    Conjunto de alimentos considerados na dieta: J
    Pre¸o da por¸˜o do alimento j: pj
       c        ca
    Quantidade do nutriente i fornecido por por¸˜o do alimento j:
                                               ca
    {Qij , ∀i ∈ I , ∀j ∈ J}




                   Alexandre Salles da Cunha   Programa¸˜o Linear
                                                       ca
Formulando o problema

 1   Vari´veis de decis˜o: xj ir´ representar a quantidade de por¸oes do
         a             a        a                                c
     alimento j que dever´ ser ingerida diariamente.
                          a
 2   Fun¸˜o objetivo: minimizar o custo da dieta:
        ca

                                           min           pj xj
                                                   j∈J

 3   Restri¸˜es do problema:
           co
       1   Satisfa¸˜o das necessidades di´rias de cada nutriente:
                  ca                     a

                                                 Qij xj ≥ di , ∀i ∈ I
                                         j∈J

       2   N˜o negatividade da quantidade ingerida de cada alimento:
             a
           xj ≥ 0, ∀j ∈ J.


                     Alexandre Salles da Cunha       Programa¸˜o Linear
                                                             ca
Resolvendo o Problema




   Trata-se de um Problema de Programa¸˜o Linear
                                      ca

   Para fins ilustrativos, usaremos o pacote GLPK para sua resolu¸˜o e a
                                                                ca
   linguagem de modelagem AMPL do GLPK.
          glpsol --model dieta.mod --output dieta.out




                 Alexandre Salles da Cunha   Programa¸˜o Linear
                                                     ca
Solu¸˜o do problema da dieta
    ca


Status: OPTIMAL Objective: CustoTotal = 67.09635836 (MINimum)
No. Row name St Activity Lower bound Upper bound Marginal
------ ------------ -- ------------- ------------- ------------- -------------
1 CustoTotal B 67.0964
2 MinNutrientes[Energia]
NL 2000 2000 0.0269739
3 MinNutrientes[Proteina]
B 78.6336 55
4 MinNutrientes[Calcio]
NL 800 800 0.0164357
No. Column name St Activity Lower bound Upper bound Marginal
------ ------------ -- ------------- ------------- ------------- -------------
1 x[Cereal] B 14.2443 0
2 x[Frango] NL 0 0 18.2731
3 x[Ovos] NL 0 0 7.79665
4 x[Leite] B 2.70706 0
5 x[Porco] NL 0 0 11.6745




                     Alexandre Salles da Cunha   Programa¸˜o Linear
                                                         ca
Resolvendo um pequeno problema graficamente




                  max                    x1 + x2
                             x1 + 2x2 ≤ 3
                             2x1 + x2 ≤ 3
                                  x1 , x2 ≥ 0




             Alexandre Salles da Cunha      Programa¸˜o Linear
                                                    ca

Mais conteúdo relacionado

Último

Estrutura Pedagógica - Laboratório de Educação a Distância.ppt
Estrutura Pedagógica - Laboratório de Educação a Distância.pptEstrutura Pedagógica - Laboratório de Educação a Distância.ppt
Estrutura Pedagógica - Laboratório de Educação a Distância.ppt
livrosjovert
 
Vogais Ilustrados para alfabetização infantil
Vogais Ilustrados para alfabetização infantilVogais Ilustrados para alfabetização infantil
Vogais Ilustrados para alfabetização infantil
mamaeieby
 
OS elementos de uma boa Redação para o ENEM.pdf
OS elementos de uma boa Redação para o ENEM.pdfOS elementos de uma boa Redação para o ENEM.pdf
OS elementos de uma boa Redação para o ENEM.pdf
AmiltonAparecido1
 
Educação trabalho HQ em sala de aula uma excelente ideia
Educação  trabalho HQ em sala de aula uma excelente  ideiaEducação  trabalho HQ em sala de aula uma excelente  ideia
Educação trabalho HQ em sala de aula uma excelente ideia
joseanesouza36
 
Pintura Romana .pptx
Pintura Romana                     .pptxPintura Romana                     .pptx
Pintura Romana .pptx
TomasSousa7
 
Potenciação e Radiciação de Números Racionais
Potenciação e Radiciação de Números RacionaisPotenciação e Radiciação de Números Racionais
Potenciação e Radiciação de Números Racionais
wagnermorais28
 
Slides Lição 11, Central Gospel, Os Mortos Em CRISTO, 2Tr24.pptx
Slides Lição 11, Central Gospel, Os Mortos Em CRISTO, 2Tr24.pptxSlides Lição 11, Central Gospel, Os Mortos Em CRISTO, 2Tr24.pptx
Slides Lição 11, Central Gospel, Os Mortos Em CRISTO, 2Tr24.pptx
LuizHenriquedeAlmeid6
 
Caderno de Resumos XVIII ENPFil UFU, IX EPGFil UFU E VII EPFEM.pdf
Caderno de Resumos XVIII ENPFil UFU, IX EPGFil UFU E VII EPFEM.pdfCaderno de Resumos XVIII ENPFil UFU, IX EPGFil UFU E VII EPFEM.pdf
Caderno de Resumos XVIII ENPFil UFU, IX EPGFil UFU E VII EPFEM.pdf
enpfilosofiaufu
 
Redação e Leitura_7º ano_58_Produção de cordel .pptx
Redação e Leitura_7º ano_58_Produção de cordel .pptxRedação e Leitura_7º ano_58_Produção de cordel .pptx
Redação e Leitura_7º ano_58_Produção de cordel .pptx
DECIOMAURINARAMOS
 
PowerPoint Newton gostava de Ler - Saber em Gel.pdf
PowerPoint Newton gostava de Ler - Saber em Gel.pdfPowerPoint Newton gostava de Ler - Saber em Gel.pdf
PowerPoint Newton gostava de Ler - Saber em Gel.pdf
1000a
 
Livro: Pedagogia do Oprimido - Paulo Freire
Livro: Pedagogia do Oprimido - Paulo FreireLivro: Pedagogia do Oprimido - Paulo Freire
Livro: Pedagogia do Oprimido - Paulo Freire
WelberMerlinCardoso
 
Atividade de reforço de matemática 2º ano
Atividade de reforço de matemática 2º anoAtividade de reforço de matemática 2º ano
Atividade de reforço de matemática 2º ano
fernandacosta37763
 
A QUESTÃO ANTROPOLÓGICA: O QUE SOMOS OU QUEM SOMOS.pdf
A QUESTÃO ANTROPOLÓGICA: O QUE SOMOS OU QUEM SOMOS.pdfA QUESTÃO ANTROPOLÓGICA: O QUE SOMOS OU QUEM SOMOS.pdf
A QUESTÃO ANTROPOLÓGICA: O QUE SOMOS OU QUEM SOMOS.pdf
AurelianoFerreirades2
 
347018542-PAULINA-CHIZIANE-Balada-de-Amor-ao-Vento-pdf.pdf
347018542-PAULINA-CHIZIANE-Balada-de-Amor-ao-Vento-pdf.pdf347018542-PAULINA-CHIZIANE-Balada-de-Amor-ao-Vento-pdf.pdf
347018542-PAULINA-CHIZIANE-Balada-de-Amor-ao-Vento-pdf.pdf
AntnioManuelAgdoma
 
Slides Lição 11, CPAD, A Realidade Bíblica do Inferno, 2Tr24.pptx
Slides Lição 11, CPAD, A Realidade Bíblica do Inferno, 2Tr24.pptxSlides Lição 11, CPAD, A Realidade Bíblica do Inferno, 2Tr24.pptx
Slides Lição 11, CPAD, A Realidade Bíblica do Inferno, 2Tr24.pptx
LuizHenriquedeAlmeid6
 
Atividade letra da música - Espalhe Amor, Anavitória.
Atividade letra da música - Espalhe  Amor, Anavitória.Atividade letra da música - Espalhe  Amor, Anavitória.
Atividade letra da música - Espalhe Amor, Anavitória.
Mary Alvarenga
 
Sinais de pontuação
Sinais de pontuaçãoSinais de pontuação
Sinais de pontuação
Mary Alvarenga
 
UFCD_10949_Lojas e-commerce no-code_índice.pdf
UFCD_10949_Lojas e-commerce no-code_índice.pdfUFCD_10949_Lojas e-commerce no-code_índice.pdf
UFCD_10949_Lojas e-commerce no-code_índice.pdf
Manuais Formação
 
A dinâmica da população mundial de acordo com as teorias populacionais.pptx
A dinâmica da população mundial de acordo com as teorias populacionais.pptxA dinâmica da população mundial de acordo com as teorias populacionais.pptx
A dinâmica da população mundial de acordo com as teorias populacionais.pptx
ReinaldoSouza57
 
759-fortaleza-resultado-definitivo-prova-objetiva-2024-05-28.pdf
759-fortaleza-resultado-definitivo-prova-objetiva-2024-05-28.pdf759-fortaleza-resultado-definitivo-prova-objetiva-2024-05-28.pdf
759-fortaleza-resultado-definitivo-prova-objetiva-2024-05-28.pdf
MessiasMarianoG
 

Último (20)

Estrutura Pedagógica - Laboratório de Educação a Distância.ppt
Estrutura Pedagógica - Laboratório de Educação a Distância.pptEstrutura Pedagógica - Laboratório de Educação a Distância.ppt
Estrutura Pedagógica - Laboratório de Educação a Distância.ppt
 
Vogais Ilustrados para alfabetização infantil
Vogais Ilustrados para alfabetização infantilVogais Ilustrados para alfabetização infantil
Vogais Ilustrados para alfabetização infantil
 
OS elementos de uma boa Redação para o ENEM.pdf
OS elementos de uma boa Redação para o ENEM.pdfOS elementos de uma boa Redação para o ENEM.pdf
OS elementos de uma boa Redação para o ENEM.pdf
 
Educação trabalho HQ em sala de aula uma excelente ideia
Educação  trabalho HQ em sala de aula uma excelente  ideiaEducação  trabalho HQ em sala de aula uma excelente  ideia
Educação trabalho HQ em sala de aula uma excelente ideia
 
Pintura Romana .pptx
Pintura Romana                     .pptxPintura Romana                     .pptx
Pintura Romana .pptx
 
Potenciação e Radiciação de Números Racionais
Potenciação e Radiciação de Números RacionaisPotenciação e Radiciação de Números Racionais
Potenciação e Radiciação de Números Racionais
 
Slides Lição 11, Central Gospel, Os Mortos Em CRISTO, 2Tr24.pptx
Slides Lição 11, Central Gospel, Os Mortos Em CRISTO, 2Tr24.pptxSlides Lição 11, Central Gospel, Os Mortos Em CRISTO, 2Tr24.pptx
Slides Lição 11, Central Gospel, Os Mortos Em CRISTO, 2Tr24.pptx
 
Caderno de Resumos XVIII ENPFil UFU, IX EPGFil UFU E VII EPFEM.pdf
Caderno de Resumos XVIII ENPFil UFU, IX EPGFil UFU E VII EPFEM.pdfCaderno de Resumos XVIII ENPFil UFU, IX EPGFil UFU E VII EPFEM.pdf
Caderno de Resumos XVIII ENPFil UFU, IX EPGFil UFU E VII EPFEM.pdf
 
Redação e Leitura_7º ano_58_Produção de cordel .pptx
Redação e Leitura_7º ano_58_Produção de cordel .pptxRedação e Leitura_7º ano_58_Produção de cordel .pptx
Redação e Leitura_7º ano_58_Produção de cordel .pptx
 
PowerPoint Newton gostava de Ler - Saber em Gel.pdf
PowerPoint Newton gostava de Ler - Saber em Gel.pdfPowerPoint Newton gostava de Ler - Saber em Gel.pdf
PowerPoint Newton gostava de Ler - Saber em Gel.pdf
 
Livro: Pedagogia do Oprimido - Paulo Freire
Livro: Pedagogia do Oprimido - Paulo FreireLivro: Pedagogia do Oprimido - Paulo Freire
Livro: Pedagogia do Oprimido - Paulo Freire
 
Atividade de reforço de matemática 2º ano
Atividade de reforço de matemática 2º anoAtividade de reforço de matemática 2º ano
Atividade de reforço de matemática 2º ano
 
A QUESTÃO ANTROPOLÓGICA: O QUE SOMOS OU QUEM SOMOS.pdf
A QUESTÃO ANTROPOLÓGICA: O QUE SOMOS OU QUEM SOMOS.pdfA QUESTÃO ANTROPOLÓGICA: O QUE SOMOS OU QUEM SOMOS.pdf
A QUESTÃO ANTROPOLÓGICA: O QUE SOMOS OU QUEM SOMOS.pdf
 
347018542-PAULINA-CHIZIANE-Balada-de-Amor-ao-Vento-pdf.pdf
347018542-PAULINA-CHIZIANE-Balada-de-Amor-ao-Vento-pdf.pdf347018542-PAULINA-CHIZIANE-Balada-de-Amor-ao-Vento-pdf.pdf
347018542-PAULINA-CHIZIANE-Balada-de-Amor-ao-Vento-pdf.pdf
 
Slides Lição 11, CPAD, A Realidade Bíblica do Inferno, 2Tr24.pptx
Slides Lição 11, CPAD, A Realidade Bíblica do Inferno, 2Tr24.pptxSlides Lição 11, CPAD, A Realidade Bíblica do Inferno, 2Tr24.pptx
Slides Lição 11, CPAD, A Realidade Bíblica do Inferno, 2Tr24.pptx
 
Atividade letra da música - Espalhe Amor, Anavitória.
Atividade letra da música - Espalhe  Amor, Anavitória.Atividade letra da música - Espalhe  Amor, Anavitória.
Atividade letra da música - Espalhe Amor, Anavitória.
 
Sinais de pontuação
Sinais de pontuaçãoSinais de pontuação
Sinais de pontuação
 
UFCD_10949_Lojas e-commerce no-code_índice.pdf
UFCD_10949_Lojas e-commerce no-code_índice.pdfUFCD_10949_Lojas e-commerce no-code_índice.pdf
UFCD_10949_Lojas e-commerce no-code_índice.pdf
 
A dinâmica da população mundial de acordo com as teorias populacionais.pptx
A dinâmica da população mundial de acordo com as teorias populacionais.pptxA dinâmica da população mundial de acordo com as teorias populacionais.pptx
A dinâmica da população mundial de acordo com as teorias populacionais.pptx
 
759-fortaleza-resultado-definitivo-prova-objetiva-2024-05-28.pdf
759-fortaleza-resultado-definitivo-prova-objetiva-2024-05-28.pdf759-fortaleza-resultado-definitivo-prova-objetiva-2024-05-28.pdf
759-fortaleza-resultado-definitivo-prova-objetiva-2024-05-28.pdf
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

[Alexandre] 1. Introducao

  • 1. Programa¸˜o Linear ca Alexandre Salles da Cunha DCC-UFMG, Mar¸o 2010 c Alexandre Salles da Cunha Programa¸˜o Linear ca
  • 2. Vamos considerar o seguinte problema Pedro deseja saber conhecer o m´ ınimo or¸amento que precisa gastar c diariamente para satisfazer suas necessidades di´rias de nutrientes, a a saber: Prote´ınas: 55 g C´lcio: 800 mg a Energia: 2000 Kcal. Para obter estas fontes de nutrientes, Pedro disp˜e dos seguintes o alimentos: Alimento Tamanho da Energia Proteina C´lcio a Pre¸o da c por¸˜o ca (kcal) (g) (mg) por¸˜o ca (centavos) Cereais 28 g 110 4 2 3 Frango 100 g 205 32 12 24 Ovos 2 grandes 160 13 54 13 Leite 237 cc 160 8 285 9 Carne porco 260 g 260 14 80 19 Alexandre Salles da Cunha Programa¸˜o Linear ca
  • 3. O problema a resolver Dentre todas as dietas (combina¸˜es de alimentos) que garantam a co satisfa¸˜o da ingest˜o m´ ca a ınima de nutrientes, apresente uma cujo custo seja m´ınimo. Identificar uma estrutura linear entre o custo e a satisfa¸ao das c˜ necessidades nutricionais com a ingest˜o de nutrientes. a Formular um Problema de Otimiza¸˜o adequado. ca Resolver o Problema. Alexandre Salles da Cunha Programa¸˜o Linear ca
  • 4. Formulando o problema Separando os dados do problema dos valores atribu´ ıdos ` instˆncia do a a problema. Conjunto de nutrientes a satisfazer: I . Necessidade di´ria de cada nutriente: {di : ∀i ∈ I } a Conjunto de alimentos considerados na dieta: J Pre¸o da por¸˜o do alimento j: pj c ca Quantidade do nutriente i fornecido por por¸˜o do alimento j: ca {Qij , ∀i ∈ I , ∀j ∈ J} Alexandre Salles da Cunha Programa¸˜o Linear ca
  • 5. Formulando o problema 1 Vari´veis de decis˜o: xj ir´ representar a quantidade de por¸oes do a a a c alimento j que dever´ ser ingerida diariamente. a 2 Fun¸˜o objetivo: minimizar o custo da dieta: ca min pj xj j∈J 3 Restri¸˜es do problema: co 1 Satisfa¸˜o das necessidades di´rias de cada nutriente: ca a Qij xj ≥ di , ∀i ∈ I j∈J 2 N˜o negatividade da quantidade ingerida de cada alimento: a xj ≥ 0, ∀j ∈ J. Alexandre Salles da Cunha Programa¸˜o Linear ca
  • 6. Resolvendo o Problema Trata-se de um Problema de Programa¸˜o Linear ca Para fins ilustrativos, usaremos o pacote GLPK para sua resolu¸˜o e a ca linguagem de modelagem AMPL do GLPK. glpsol --model dieta.mod --output dieta.out Alexandre Salles da Cunha Programa¸˜o Linear ca
  • 7. Solu¸˜o do problema da dieta ca Status: OPTIMAL Objective: CustoTotal = 67.09635836 (MINimum) No. Row name St Activity Lower bound Upper bound Marginal ------ ------------ -- ------------- ------------- ------------- ------------- 1 CustoTotal B 67.0964 2 MinNutrientes[Energia] NL 2000 2000 0.0269739 3 MinNutrientes[Proteina] B 78.6336 55 4 MinNutrientes[Calcio] NL 800 800 0.0164357 No. Column name St Activity Lower bound Upper bound Marginal ------ ------------ -- ------------- ------------- ------------- ------------- 1 x[Cereal] B 14.2443 0 2 x[Frango] NL 0 0 18.2731 3 x[Ovos] NL 0 0 7.79665 4 x[Leite] B 2.70706 0 5 x[Porco] NL 0 0 11.6745 Alexandre Salles da Cunha Programa¸˜o Linear ca
  • 8. Resolvendo um pequeno problema graficamente max x1 + x2 x1 + 2x2 ≤ 3 2x1 + x2 ≤ 3 x1 , x2 ≥ 0 Alexandre Salles da Cunha Programa¸˜o Linear ca