SlideShare una empresa de Scribd logo
1 de 8
Descargar para leer sin conexión
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

Más contenido relacionado

Último

Seminário Biologia e desenvolvimento da matrinxa.pptx
Seminário Biologia e desenvolvimento da matrinxa.pptxSeminário Biologia e desenvolvimento da matrinxa.pptx
Seminário Biologia e desenvolvimento da matrinxa.pptxReinaldoMuller1
 
Rota das Ribeiras Camp, Projeto Nós Propomos!
Rota das Ribeiras Camp, Projeto Nós Propomos!Rota das Ribeiras Camp, Projeto Nós Propomos!
Rota das Ribeiras Camp, Projeto Nós Propomos!Ilda Bicacro
 
Nós Propomos! Autocarros Elétricos - Trabalho desenvolvido no âmbito de Cidad...
Nós Propomos! Autocarros Elétricos - Trabalho desenvolvido no âmbito de Cidad...Nós Propomos! Autocarros Elétricos - Trabalho desenvolvido no âmbito de Cidad...
Nós Propomos! Autocarros Elétricos - Trabalho desenvolvido no âmbito de Cidad...Ilda Bicacro
 
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdfPROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdfHELENO FAVACHO
 
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSOLeloIurk1
 
Estudar, para quê? Ciência, para quê? Parte 1 e Parte 2
Estudar, para quê?  Ciência, para quê? Parte 1 e Parte 2Estudar, para quê?  Ciência, para quê? Parte 1 e Parte 2
Estudar, para quê? Ciência, para quê? Parte 1 e Parte 2Maria Teresa Thomaz
 
migração e trabalho 2º ano.pptx fenomenos
migração e trabalho 2º ano.pptx fenomenosmigração e trabalho 2º ano.pptx fenomenos
migração e trabalho 2º ano.pptx fenomenosLucianoPrado15
 
SSE_BQ_Matematica_4A_SR.pdfffffffffffffffffffffffffffffffffff
SSE_BQ_Matematica_4A_SR.pdfffffffffffffffffffffffffffffffffffSSE_BQ_Matematica_4A_SR.pdfffffffffffffffffffffffffffffffffff
SSE_BQ_Matematica_4A_SR.pdfffffffffffffffffffffffffffffffffffNarlaAquino
 
LISTA DE EXERCICIOS envolveto grandezas e medidas e notação cientifica 1 ANO ...
LISTA DE EXERCICIOS envolveto grandezas e medidas e notação cientifica 1 ANO ...LISTA DE EXERCICIOS envolveto grandezas e medidas e notação cientifica 1 ANO ...
LISTA DE EXERCICIOS envolveto grandezas e medidas e notação cientifica 1 ANO ...Francisco Márcio Bezerra Oliveira
 
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdfRecomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdfFrancisco Márcio Bezerra Oliveira
 
Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)ElliotFerreira
 
19- Pedagogia (60 mapas mentais) - Amostra.pdf
19- Pedagogia (60 mapas mentais) - Amostra.pdf19- Pedagogia (60 mapas mentais) - Amostra.pdf
19- Pedagogia (60 mapas mentais) - Amostra.pdfmarlene54545
 
Slide - EBD ADEB 2024 Licao 02 2Trim.pptx
Slide - EBD ADEB 2024 Licao 02 2Trim.pptxSlide - EBD ADEB 2024 Licao 02 2Trim.pptx
Slide - EBD ADEB 2024 Licao 02 2Trim.pptxedelon1
 
PROJETO DE EXTENSÃO - EDUCAÇÃO FÍSICA BACHARELADO.pdf
PROJETO DE EXTENSÃO - EDUCAÇÃO FÍSICA BACHARELADO.pdfPROJETO DE EXTENSÃO - EDUCAÇÃO FÍSICA BACHARELADO.pdf
PROJETO DE EXTENSÃO - EDUCAÇÃO FÍSICA BACHARELADO.pdfHELENO FAVACHO
 
Projeto de Extensão - ENGENHARIA DE SOFTWARE - BACHARELADO.pdf
Projeto de Extensão - ENGENHARIA DE SOFTWARE - BACHARELADO.pdfProjeto de Extensão - ENGENHARIA DE SOFTWARE - BACHARELADO.pdf
Projeto de Extensão - ENGENHARIA DE SOFTWARE - BACHARELADO.pdfHELENO FAVACHO
 
aula de bioquímica bioquímica dos carboidratos.ppt
aula de bioquímica bioquímica dos carboidratos.pptaula de bioquímica bioquímica dos carboidratos.ppt
aula de bioquímica bioquímica dos carboidratos.pptssuser2b53fe
 
PRÁTICAS PEDAGÓGICAS GESTÃO DA APRENDIZAGEM
PRÁTICAS PEDAGÓGICAS GESTÃO DA APRENDIZAGEMPRÁTICAS PEDAGÓGICAS GESTÃO DA APRENDIZAGEM
PRÁTICAS PEDAGÓGICAS GESTÃO DA APRENDIZAGEMHELENO FAVACHO
 
PROJETO DE EXTENÇÃO - GESTÃO DE RECURSOS HUMANOS.pdf
PROJETO DE EXTENÇÃO - GESTÃO DE RECURSOS HUMANOS.pdfPROJETO DE EXTENÇÃO - GESTÃO DE RECURSOS HUMANOS.pdf
PROJETO DE EXTENÇÃO - GESTÃO DE RECURSOS HUMANOS.pdfHELENO FAVACHO
 
About Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de HotéisAbout Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de Hotéisines09cachapa
 
PROJETO DE EXTENSÃO I - AGRONOMIA.pdf AGRONOMIAAGRONOMIA
PROJETO DE EXTENSÃO I - AGRONOMIA.pdf AGRONOMIAAGRONOMIAPROJETO DE EXTENSÃO I - AGRONOMIA.pdf AGRONOMIAAGRONOMIA
PROJETO DE EXTENSÃO I - AGRONOMIA.pdf AGRONOMIAAGRONOMIAHELENO FAVACHO
 

Último (20)

Seminário Biologia e desenvolvimento da matrinxa.pptx
Seminário Biologia e desenvolvimento da matrinxa.pptxSeminário Biologia e desenvolvimento da matrinxa.pptx
Seminário Biologia e desenvolvimento da matrinxa.pptx
 
Rota das Ribeiras Camp, Projeto Nós Propomos!
Rota das Ribeiras Camp, Projeto Nós Propomos!Rota das Ribeiras Camp, Projeto Nós Propomos!
Rota das Ribeiras Camp, Projeto Nós Propomos!
 
Nós Propomos! Autocarros Elétricos - Trabalho desenvolvido no âmbito de Cidad...
Nós Propomos! Autocarros Elétricos - Trabalho desenvolvido no âmbito de Cidad...Nós Propomos! Autocarros Elétricos - Trabalho desenvolvido no âmbito de Cidad...
Nós Propomos! Autocarros Elétricos - Trabalho desenvolvido no âmbito de Cidad...
 
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdfPROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
 
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
 
Estudar, para quê? Ciência, para quê? Parte 1 e Parte 2
Estudar, para quê?  Ciência, para quê? Parte 1 e Parte 2Estudar, para quê?  Ciência, para quê? Parte 1 e Parte 2
Estudar, para quê? Ciência, para quê? Parte 1 e Parte 2
 
migração e trabalho 2º ano.pptx fenomenos
migração e trabalho 2º ano.pptx fenomenosmigração e trabalho 2º ano.pptx fenomenos
migração e trabalho 2º ano.pptx fenomenos
 
SSE_BQ_Matematica_4A_SR.pdfffffffffffffffffffffffffffffffffff
SSE_BQ_Matematica_4A_SR.pdfffffffffffffffffffffffffffffffffffSSE_BQ_Matematica_4A_SR.pdfffffffffffffffffffffffffffffffffff
SSE_BQ_Matematica_4A_SR.pdfffffffffffffffffffffffffffffffffff
 
LISTA DE EXERCICIOS envolveto grandezas e medidas e notação cientifica 1 ANO ...
LISTA DE EXERCICIOS envolveto grandezas e medidas e notação cientifica 1 ANO ...LISTA DE EXERCICIOS envolveto grandezas e medidas e notação cientifica 1 ANO ...
LISTA DE EXERCICIOS envolveto grandezas e medidas e notação cientifica 1 ANO ...
 
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdfRecomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
 
Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)
 
19- Pedagogia (60 mapas mentais) - Amostra.pdf
19- Pedagogia (60 mapas mentais) - Amostra.pdf19- Pedagogia (60 mapas mentais) - Amostra.pdf
19- Pedagogia (60 mapas mentais) - Amostra.pdf
 
Slide - EBD ADEB 2024 Licao 02 2Trim.pptx
Slide - EBD ADEB 2024 Licao 02 2Trim.pptxSlide - EBD ADEB 2024 Licao 02 2Trim.pptx
Slide - EBD ADEB 2024 Licao 02 2Trim.pptx
 
PROJETO DE EXTENSÃO - EDUCAÇÃO FÍSICA BACHARELADO.pdf
PROJETO DE EXTENSÃO - EDUCAÇÃO FÍSICA BACHARELADO.pdfPROJETO DE EXTENSÃO - EDUCAÇÃO FÍSICA BACHARELADO.pdf
PROJETO DE EXTENSÃO - EDUCAÇÃO FÍSICA BACHARELADO.pdf
 
Projeto de Extensão - ENGENHARIA DE SOFTWARE - BACHARELADO.pdf
Projeto de Extensão - ENGENHARIA DE SOFTWARE - BACHARELADO.pdfProjeto de Extensão - ENGENHARIA DE SOFTWARE - BACHARELADO.pdf
Projeto de Extensão - ENGENHARIA DE SOFTWARE - BACHARELADO.pdf
 
aula de bioquímica bioquímica dos carboidratos.ppt
aula de bioquímica bioquímica dos carboidratos.pptaula de bioquímica bioquímica dos carboidratos.ppt
aula de bioquímica bioquímica dos carboidratos.ppt
 
PRÁTICAS PEDAGÓGICAS GESTÃO DA APRENDIZAGEM
PRÁTICAS PEDAGÓGICAS GESTÃO DA APRENDIZAGEMPRÁTICAS PEDAGÓGICAS GESTÃO DA APRENDIZAGEM
PRÁTICAS PEDAGÓGICAS GESTÃO DA APRENDIZAGEM
 
PROJETO DE EXTENÇÃO - GESTÃO DE RECURSOS HUMANOS.pdf
PROJETO DE EXTENÇÃO - GESTÃO DE RECURSOS HUMANOS.pdfPROJETO DE EXTENÇÃO - GESTÃO DE RECURSOS HUMANOS.pdf
PROJETO DE EXTENÇÃO - GESTÃO DE RECURSOS HUMANOS.pdf
 
About Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de HotéisAbout Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de Hotéis
 
PROJETO DE EXTENSÃO I - AGRONOMIA.pdf AGRONOMIAAGRONOMIA
PROJETO DE EXTENSÃO I - AGRONOMIA.pdf AGRONOMIAAGRONOMIAPROJETO DE EXTENSÃO I - AGRONOMIA.pdf AGRONOMIAAGRONOMIA
PROJETO DE EXTENSÃO I - AGRONOMIA.pdf AGRONOMIAAGRONOMIA
 

Destacado

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 HubspotMarius 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 ChatGPTExpeed 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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil 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 2024Albert 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 InsightsKurio // 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 2024Search 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 summarySpeakerHub
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit 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 managementMindGenius
 
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
 

Destacado (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