SlideShare a Scribd company logo
Pesquisa Operacional – Programação Linear no R-project



     O método simplex é utilizado na resolução de problemas de
  transporte onde se deseja minimizar o custo de transporte, aplicamos
  a técnica na minimização do custo de um problema de transporte com
Graziela oito destinos. O método foi desenvolvido no2012
 oito origens e
                M. Alves - PO - UFS software
  estatístico R- Project, onde é possível aplicar o método simplex,
  carregando inicialmente o pacote library(boot).
Pesquisa Operacional – Programação Linear no R-project

     O problema de transporte é um tipo especial de
   problema de programação linear que trata do envio de
   produtos da origem para o destino. O problema de
Graziela M. Alves - PO e- também 2012
  designação designa atividades, UFS é um
   problema   onde    aplica-se   programação   linear,   no
   presente trabalho a origem são trabalhadores e o
   destino a carga horária de trabalho.
Pesquisa Operacional – Programação Linear no R-project



     No    R-   Project,   carregamos    o   pacote
   library(boot), escrevemos a função objetivo,
Graziela M. as restrições e -em seguida
  escrevemos Alves - PO UFS 2012
   usamos o algoritmo que realiza o cálculo de
   minimização de custos através do SIMPLEX.
Pesquisa Operacional – Programação Linear no R-project

 PROBLEMA DE TRANSPORTE

    Uma empresa é contratada pelo MDS, para distribuir
 laranjas em municípios do alto sertão sergipano. Os
Graziela M. Alves - laranja.-Deseja-se 2012
 municípios de origem produzem PO UFS saber
 a melhor forma de planejar a distribuição de laranja para
 os municípios do alto sertão, de modo que o custo seja
 mínimo. Cada caminhão tipo baú tem capacidade máxima
 de 41.000 Kg de laranja e a demanda de cada município é
 de 40.000 Kg de laranja.
Tabela c/ custos do transporte




Graziela M. Alves - PO - UFS 2012
Solução no R
> #Implementando no R o problema de transporte de 5 origens e 5 destinos
> library (boot) #Pacote com o comando SIMPLEX no R
> z=c(60,40,70,50,30,30,30,60,70,50,50,60,80,70,40,40,50,60,70,60,30,40,70,60,50)
> #Abaixo as restrições, considerando que o sistema é equilibrado
> res1=c(1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
> res2=c(0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
> res3=c(0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0)
> res4=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0)
> res5=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1)
> simplex(a=z,A3=rbind(res1,res2,res3,res4,res5),b3=c(40000),maxi=FALSE)
#as restrições são iguais, já que o sistema é equilibrado, sendo assim não repete-se 40000, 5 vezes.
> library(boot)
> z=c(60,40,70,50,30,30,30,60,70,50,50,60,80,70,40,40,50,60,70,60,30,40,70,60,50)
> length(z)

Graziela M. Alves - PO - UFS 2012
[1] 25
> res1=c(1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
> res2=c(0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
> res3=c(0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0)
> res4=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0)
> res5=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1)
> simplex(a=z,A3=rbind(res1,res2,res3,res4,res5),b3=c(40000),maxi=FALSE)


Linear Programming Results


Call : simplex(a = z, A3 = rbind(res1, res2, res3, res4, res5), b3 = c(40000),
  maxi = FALSE)


Minimization Problem with Objective Function Coefficients
 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25
Pesquisa Operacional – Programação Linear no R-project

   60 40 70 50 30 30 30 60 70 50 50 60 80 70 40 40 50 60 70 60 30 40 70 60 50




   Optimal solution has the following values




Graziela M. Alves - PO - UFS 2012
        x1
   x24 x25
              x2   x3   x4   x5   x6   x7   x8       x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23




          0    0   0    0 40000 40000       0    0     0   0   0   0   0   0 40000 40000   0   0   0   0 40000   0   0   0
   0

   The optimal value of the objective function is 6800000.
Pesquisa Operacional – Programação Linear no R-project

    PROBLEMA DE DESIGNAÇÃO

      Uma empresa em convesão coletiva de trabalho decidiu
    pagar seus trabalhadores por horas de trabalho, foi pactuado
    que as horas-extras também seguiriam a tabela de hora de
Graziela M. por oito categorias em acordo coletivo de
  trabalho, decidida
                     Alves - PO - UFS 2012
    trabalho.   Porém   notando   aumento    dos   gastos   com
    pagamento de funcionários a empresa deseja determinar uma
    carga horária fixa para cada trabalhador, de modo a minimizar
    os gastos com pagamento de salário de funcionários.
Pesquisa Operacional – Programação Linear no R-project




Graziela M. Alves - PO - UFS 2012
Problema de designação com 8 origens e 8 destinos. Resolução no R

      > library(boot)

      >
z=c(40,42,44,46,40,41,38,46,46,41,40,42,45,43,45,43,43,45,42,41,30,44,38,30,44,30,41,45,38,42,44,40,42,40,45,38,46,38,39,41,41,46,4
6,44,43,40,46,45,45,43,48,39,44,42,30,39,30,44,41,46,46,30,44,42)

      >res1=c(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

      > res2=c(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

      > res3=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

      > res4=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

Graziela M. Alves - PO - UFS 2012
      > res5=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

      > res6=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

      > res7=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0)

      > res8=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1)

      > simplex(a=z,A3=rbind(res1,res2,res3,res4,res5,res6,res7,res8),b3=c(1,1,1,1,1,1,1,1),maxi=FALSE)
Linear Programming Results




      Call : simplex(a = z, A3 = rbind(res1, res2, res3, res4, res5, res6,

        res7, res8), b3 = c(1, 1, 1, 1, 1, 1, 1, 1), maxi = FALSE)

Graziela M. Alves - PO - UFS 2012
      Minimization Problem with Objective Function Coefficients

       x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27
  x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41

       40 42 44 46 40 41 38 46 46 41 40 42 45 43 45 43 43 45 42 41 30 44 38 30 44 30 41 45 38
  42 44 40 42 40 45 38 46 38 39 41 41

      x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64

       46 46 44 43 40 46 45 45 43 48 39 44 42 30 39 30 44 41 46 46 30 44 42
Optimal solution has the following values

       x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22
  x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41

       0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0

Graziela M. Alves - PO - UFS 2012
  0 0 0 0 0 0 0 1 0 0 0 0 0

      x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62
  x63 x64

       0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0

      The optimal value of the objective function is 276.
Pesquisa Operacional – Programação Linear no R-project

   REFERÊNCIAS BIBLIOGRÁFICAS

      [1] Ajuda do software R, acesso em 31 de outubro de 2012 às 20 horas

      < http://127.0.0.1:25218/library/boot/html/simplex.html >

Graziela M. Alves - PO - UFS 2012
      [2] AGOSTI, Cristiano. Apostila de Pesquisa Operacional. Universidade do
   Oeste de Santa Catarina. Xânxere Santa Catarina, agosto de 2003.

      [3] Aplicação de Programação Linear no Software Estatístico R-gui.
   Acesso em 25 de outubro de 2012 às 21 horas. < http://goo.gl/e13z6 >

      [4] PRADO, Santos Darci. PERT/ CPM volume 4. INDG Tecnologia e
   Serviços LTDA, Nova Lima – MG 2004.

More Related Content

Similar to Pesquisa Operacional no R

Ms(lpgraphicalsoln.)[1]
Ms(lpgraphicalsoln.)[1]Ms(lpgraphicalsoln.)[1]
Ms(lpgraphicalsoln.)[1]
Manisha Kaushal
 
Five Minute Speech: Activities Developed in Computational Geometry Discipline
Five Minute Speech: Activities Developed in Computational Geometry DisciplineFive Minute Speech: Activities Developed in Computational Geometry Discipline
Five Minute Speech: Activities Developed in Computational Geometry Discipline
Michel Alves
 
Deterministic Oversubscription Action Planning with General Utility Functions...
Deterministic Oversubscription Action Planning with General Utility Functions...Deterministic Oversubscription Action Planning with General Utility Functions...
Deterministic Oversubscription Action Planning with General Utility Functions...
Daniel Muller
 
Project Operation Management
Project Operation Management Project Operation Management
Project Operation Management
MureedAbbas
 
Mb0048 operations research
Mb0048 operations researchMb0048 operations research
Mb0048 operations research
smumbahelp
 
Online_News_Popularity_Machine_Learning
Online_News_Popularity_Machine_LearningOnline_News_Popularity_Machine_Learning
Online_News_Popularity_Machine_Learning
Dibyajyoti Bose
 
KMAP PAPER (1)
KMAP PAPER (1)KMAP PAPER (1)
KMAP PAPER (1)
Aleksey Levkovskyi
 
Network Design in Gurobi - final.pptx
Network Design in Gurobi - final.pptxNetwork Design in Gurobi - final.pptx
Network Design in Gurobi - final.pptx
DebarpanHaldar1
 
Vignesh Balasubramanian's Resume
Vignesh Balasubramanian's Resume Vignesh Balasubramanian's Resume
Vignesh Balasubramanian's Resume
Vignesh Balasubramanian
 
Vcs slides on or 2014
Vcs slides on or 2014Vcs slides on or 2014
Vcs slides on or 2014
Shakti Ranjan
 
SVD and the Netflix Dataset
SVD and the Netflix DatasetSVD and the Netflix Dataset
SVD and the Netflix Dataset
Ben Mabey
 
A Study on Linear Programming Problem
A Study on Linear Programming ProblemA Study on Linear Programming Problem
A Study on Linear Programming Problem
ijtsrd
 
Minimal Introduction to C++ - Part I
Minimal Introduction to C++ - Part IMinimal Introduction to C++ - Part I
Minimal Introduction to C++ - Part I
Michel Alves
 
A Double Lexicase Selection Operator for Bloat Control in Evolutionary Featur...
A Double Lexicase Selection Operator for Bloat Control in Evolutionary Featur...A Double Lexicase Selection Operator for Bloat Control in Evolutionary Featur...
A Double Lexicase Selection Operator for Bloat Control in Evolutionary Featur...
Hengzhe Zhang
 
Quantitative Techniques
Quantitative TechniquesQuantitative Techniques
Quantitative Techniques
Deepthy Sai Manikandan
 
Innovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilitiesInnovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilities
IBM Decision Optimization
 
Business Optimizer Introduction
Business Optimizer IntroductionBusiness Optimizer Introduction
Business Optimizer Introduction
Donato Marrazzo
 
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Pooyan Jamshidi
 
Using Open Source Tools for Machine Learning
Using Open Source Tools for Machine LearningUsing Open Source Tools for Machine Learning
Using Open Source Tools for Machine Learning
All Things Open
 
Simple rules for building robust machine learning models
Simple rules for building robust machine learning modelsSimple rules for building robust machine learning models
Simple rules for building robust machine learning models
Kyriakos Chatzidimitriou
 

Similar to Pesquisa Operacional no R (20)

Ms(lpgraphicalsoln.)[1]
Ms(lpgraphicalsoln.)[1]Ms(lpgraphicalsoln.)[1]
Ms(lpgraphicalsoln.)[1]
 
Five Minute Speech: Activities Developed in Computational Geometry Discipline
Five Minute Speech: Activities Developed in Computational Geometry DisciplineFive Minute Speech: Activities Developed in Computational Geometry Discipline
Five Minute Speech: Activities Developed in Computational Geometry Discipline
 
Deterministic Oversubscription Action Planning with General Utility Functions...
Deterministic Oversubscription Action Planning with General Utility Functions...Deterministic Oversubscription Action Planning with General Utility Functions...
Deterministic Oversubscription Action Planning with General Utility Functions...
 
Project Operation Management
Project Operation Management Project Operation Management
Project Operation Management
 
Mb0048 operations research
Mb0048 operations researchMb0048 operations research
Mb0048 operations research
 
Online_News_Popularity_Machine_Learning
Online_News_Popularity_Machine_LearningOnline_News_Popularity_Machine_Learning
Online_News_Popularity_Machine_Learning
 
KMAP PAPER (1)
KMAP PAPER (1)KMAP PAPER (1)
KMAP PAPER (1)
 
Network Design in Gurobi - final.pptx
Network Design in Gurobi - final.pptxNetwork Design in Gurobi - final.pptx
Network Design in Gurobi - final.pptx
 
Vignesh Balasubramanian's Resume
Vignesh Balasubramanian's Resume Vignesh Balasubramanian's Resume
Vignesh Balasubramanian's Resume
 
Vcs slides on or 2014
Vcs slides on or 2014Vcs slides on or 2014
Vcs slides on or 2014
 
SVD and the Netflix Dataset
SVD and the Netflix DatasetSVD and the Netflix Dataset
SVD and the Netflix Dataset
 
A Study on Linear Programming Problem
A Study on Linear Programming ProblemA Study on Linear Programming Problem
A Study on Linear Programming Problem
 
Minimal Introduction to C++ - Part I
Minimal Introduction to C++ - Part IMinimal Introduction to C++ - Part I
Minimal Introduction to C++ - Part I
 
A Double Lexicase Selection Operator for Bloat Control in Evolutionary Featur...
A Double Lexicase Selection Operator for Bloat Control in Evolutionary Featur...A Double Lexicase Selection Operator for Bloat Control in Evolutionary Featur...
A Double Lexicase Selection Operator for Bloat Control in Evolutionary Featur...
 
Quantitative Techniques
Quantitative TechniquesQuantitative Techniques
Quantitative Techniques
 
Innovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilitiesInnovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilities
 
Business Optimizer Introduction
Business Optimizer IntroductionBusiness Optimizer Introduction
Business Optimizer Introduction
 
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
 
Using Open Source Tools for Machine Learning
Using Open Source Tools for Machine LearningUsing Open Source Tools for Machine Learning
Using Open Source Tools for Machine Learning
 
Simple rules for building robust machine learning models
Simple rules for building robust machine learning modelsSimple rules for building robust machine learning models
Simple rules for building robust machine learning models
 

More from Graziela Alves

Esgotos- Resumo
Esgotos- ResumoEsgotos- Resumo
Esgotos- Resumo
Graziela Alves
 
Teste de Normalidade, teste T e teste F no R
Teste de Normalidade, teste T e teste F no RTeste de Normalidade, teste T e teste F no R
Teste de Normalidade, teste T e teste F no R
Graziela Alves
 
Licitação
LicitaçãoLicitação
Licitação
Graziela Alves
 
Regime disciplinar do Servidor Público
Regime disciplinar do Servidor PúblicoRegime disciplinar do Servidor Público
Regime disciplinar do Servidor Público
Graziela Alves
 
Alisantes de cabelos com formol
Alisantes de cabelos com formol  Alisantes de cabelos com formol
Alisantes de cabelos com formol
Graziela Alves
 
Libras
LibrasLibras
Rio + 20
Rio + 20Rio + 20
Rio + 20
Graziela Alves
 
Bolsa verde
Bolsa verdeBolsa verde
Bolsa verde
Graziela Alves
 

More from Graziela Alves (8)

Esgotos- Resumo
Esgotos- ResumoEsgotos- Resumo
Esgotos- Resumo
 
Teste de Normalidade, teste T e teste F no R
Teste de Normalidade, teste T e teste F no RTeste de Normalidade, teste T e teste F no R
Teste de Normalidade, teste T e teste F no R
 
Licitação
LicitaçãoLicitação
Licitação
 
Regime disciplinar do Servidor Público
Regime disciplinar do Servidor PúblicoRegime disciplinar do Servidor Público
Regime disciplinar do Servidor Público
 
Alisantes de cabelos com formol
Alisantes de cabelos com formol  Alisantes de cabelos com formol
Alisantes de cabelos com formol
 
Libras
LibrasLibras
Libras
 
Rio + 20
Rio + 20Rio + 20
Rio + 20
 
Bolsa verde
Bolsa verdeBolsa verde
Bolsa verde
 

Recently uploaded

Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 

Recently uploaded (20)

Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 

Pesquisa Operacional no R

  • 1. Pesquisa Operacional – Programação Linear no R-project O método simplex é utilizado na resolução de problemas de transporte onde se deseja minimizar o custo de transporte, aplicamos a técnica na minimização do custo de um problema de transporte com Graziela oito destinos. O método foi desenvolvido no2012 oito origens e M. Alves - PO - UFS software estatístico R- Project, onde é possível aplicar o método simplex, carregando inicialmente o pacote library(boot).
  • 2. Pesquisa Operacional – Programação Linear no R-project O problema de transporte é um tipo especial de problema de programação linear que trata do envio de produtos da origem para o destino. O problema de Graziela M. Alves - PO e- também 2012 designação designa atividades, UFS é um problema onde aplica-se programação linear, no presente trabalho a origem são trabalhadores e o destino a carga horária de trabalho.
  • 3. Pesquisa Operacional – Programação Linear no R-project No R- Project, carregamos o pacote library(boot), escrevemos a função objetivo, Graziela M. as restrições e -em seguida escrevemos Alves - PO UFS 2012 usamos o algoritmo que realiza o cálculo de minimização de custos através do SIMPLEX.
  • 4. Pesquisa Operacional – Programação Linear no R-project PROBLEMA DE TRANSPORTE Uma empresa é contratada pelo MDS, para distribuir laranjas em municípios do alto sertão sergipano. Os Graziela M. Alves - laranja.-Deseja-se 2012 municípios de origem produzem PO UFS saber a melhor forma de planejar a distribuição de laranja para os municípios do alto sertão, de modo que o custo seja mínimo. Cada caminhão tipo baú tem capacidade máxima de 41.000 Kg de laranja e a demanda de cada município é de 40.000 Kg de laranja.
  • 5. Tabela c/ custos do transporte Graziela M. Alves - PO - UFS 2012
  • 6. Solução no R > #Implementando no R o problema de transporte de 5 origens e 5 destinos > library (boot) #Pacote com o comando SIMPLEX no R > z=c(60,40,70,50,30,30,30,60,70,50,50,60,80,70,40,40,50,60,70,60,30,40,70,60,50) > #Abaixo as restrições, considerando que o sistema é equilibrado > res1=c(1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res2=c(0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res3=c(0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0) > res4=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0) > res5=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1) > simplex(a=z,A3=rbind(res1,res2,res3,res4,res5),b3=c(40000),maxi=FALSE) #as restrições são iguais, já que o sistema é equilibrado, sendo assim não repete-se 40000, 5 vezes. > library(boot) > z=c(60,40,70,50,30,30,30,60,70,50,50,60,80,70,40,40,50,60,70,60,30,40,70,60,50) > length(z) Graziela M. Alves - PO - UFS 2012 [1] 25 > res1=c(1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res2=c(0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res3=c(0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0) > res4=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0) > res5=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1) > simplex(a=z,A3=rbind(res1,res2,res3,res4,res5),b3=c(40000),maxi=FALSE) Linear Programming Results Call : simplex(a = z, A3 = rbind(res1, res2, res3, res4, res5), b3 = c(40000), maxi = FALSE) Minimization Problem with Objective Function Coefficients x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25
  • 7. Pesquisa Operacional – Programação Linear no R-project 60 40 70 50 30 30 30 60 70 50 50 60 80 70 40 40 50 60 70 60 30 40 70 60 50 Optimal solution has the following values Graziela M. Alves - PO - UFS 2012 x1 x24 x25 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 0 0 0 0 40000 40000 0 0 0 0 0 0 0 0 40000 40000 0 0 0 0 40000 0 0 0 0 The optimal value of the objective function is 6800000.
  • 8. Pesquisa Operacional – Programação Linear no R-project PROBLEMA DE DESIGNAÇÃO Uma empresa em convesão coletiva de trabalho decidiu pagar seus trabalhadores por horas de trabalho, foi pactuado que as horas-extras também seguiriam a tabela de hora de Graziela M. por oito categorias em acordo coletivo de trabalho, decidida Alves - PO - UFS 2012 trabalho. Porém notando aumento dos gastos com pagamento de funcionários a empresa deseja determinar uma carga horária fixa para cada trabalhador, de modo a minimizar os gastos com pagamento de salário de funcionários.
  • 9. Pesquisa Operacional – Programação Linear no R-project Graziela M. Alves - PO - UFS 2012
  • 10. Problema de designação com 8 origens e 8 destinos. Resolução no R > library(boot) > z=c(40,42,44,46,40,41,38,46,46,41,40,42,45,43,45,43,43,45,42,41,30,44,38,30,44,30,41,45,38,42,44,40,42,40,45,38,46,38,39,41,41,46,4 6,44,43,40,46,45,45,43,48,39,44,42,30,39,30,44,41,46,46,30,44,42) >res1=c(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res2=c(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res3=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res4=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) Graziela M. Alves - PO - UFS 2012 > res5=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res6=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) > res7=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0) > res8=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1) > simplex(a=z,A3=rbind(res1,res2,res3,res4,res5,res6,res7,res8),b3=c(1,1,1,1,1,1,1,1),maxi=FALSE)
  • 11. Linear Programming Results Call : simplex(a = z, A3 = rbind(res1, res2, res3, res4, res5, res6, res7, res8), b3 = c(1, 1, 1, 1, 1, 1, 1, 1), maxi = FALSE) Graziela M. Alves - PO - UFS 2012 Minimization Problem with Objective Function Coefficients x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 40 42 44 46 40 41 38 46 46 41 40 42 45 43 45 43 43 45 42 41 30 44 38 30 44 30 41 45 38 42 44 40 42 40 45 38 46 38 39 41 41 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64 46 46 44 43 40 46 45 45 43 48 39 44 42 30 39 30 44 41 46 46 30 44 42
  • 12. Optimal solution has the following values x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 Graziela M. Alves - PO - UFS 2012 0 0 0 0 0 0 0 1 0 0 0 0 0 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 The optimal value of the objective function is 276.
  • 13. Pesquisa Operacional – Programação Linear no R-project REFERÊNCIAS BIBLIOGRÁFICAS [1] Ajuda do software R, acesso em 31 de outubro de 2012 às 20 horas < http://127.0.0.1:25218/library/boot/html/simplex.html > Graziela M. Alves - PO - UFS 2012 [2] AGOSTI, Cristiano. Apostila de Pesquisa Operacional. Universidade do Oeste de Santa Catarina. Xânxere Santa Catarina, agosto de 2003. [3] Aplicação de Programação Linear no Software Estatístico R-gui. Acesso em 25 de outubro de 2012 às 21 horas. < http://goo.gl/e13z6 > [4] PRADO, Santos Darci. PERT/ CPM volume 4. INDG Tecnologia e Serviços LTDA, Nova Lima – MG 2004.