27
Túlio A. M. Toffolo http://www.toffolo.com.br Otimização Linear e Inteira Aula 10: Revisão 1 2018/2 - PCC174/BCC464 Aula Prática - Laboratório COM30

Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

Túlio A. M. Toffolo http://www.toffolo.com.br

Otimização Linear e InteiraAula 10: Revisão

!1

2018/2 - PCC174/BCC464 Aula Prática - Laboratório COM30

Page 2: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Breve RevisãoThe football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Modelagem

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Método gráfico

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

O Algoritmo Simplex Forma padrão Soluções Básicas Método de Duas Fases

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Dualidade

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Análise de Sensibilidade

!2

Page 3: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

Modelagem

Page 4: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Como modelar PLs?The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

O segredo é: praticar

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Lembre-se: apenas consideramos modelos com variáveis contínuas por enquanto!

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Dicas: Não se limite aos exemplos apresentados em aula. Os livros indicados na ementa da disciplina possuem exemplos e exercícios resolvidos.

!4

Page 5: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

Método Gráfico

Page 6: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Método GráficoThe football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Pode ser utilizado para resolver problemas com até três variáveis.

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Muito útil para entender os principais conceitos envolvidos em Programação Linear (Inteira).

!6

Page 7: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão !7

x1

x2

�1 1 2 3 4 5 6 7 8 9 10 11 12�1

1

2

3

4

5

6

7

8

9

10

11

12

1

5x1+2x2 � 254x1�3x2 � �3x1 � 2x1, x2 � 0

5 / 48 Túlio Toffolo – Otimização Linear e Inteira – Aula 02: Algoritmo Simplex

Page 8: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão !8

O Gráfico

x1

x2

1 2 3 4 5 6 7 8

12345671720,4

Variáveis:x1: qtde de sojax2: qtde de milho

Restrições:Dinheiro (máx: 350)

soja: 70milho: 5070x1 + 50x2 350

Peso (máx: 400)soja: 50milho: 8050x1 + 80x2 400

Disponibilidadesoja: 4x1 4

Lucro (Objetivo):

Max. 300x1 + 280x2

26 / 30 Túlio Toffolo – Otimização Linear e Inteira – Aula 01: Introdução

Page 9: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

Algoritmo Simplex

Page 10: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Formas canônica e padrão

!10

Ou ainda, considerando-se separadamente as forma padrão e canônica:

TABELA 4.2 FORMA PADRÃO E CANÔNICA

Primal Dual

Forma Canônica

Min z = cx

sujeito a:Ax ! bx ! 0

Max w = ub

sujeito a:uA " cu ! 0

Forma Padrão

Min z = cx

sujeito a:Ax = b

x ! 0

Max w = ub

sujeito a:uA " cu # R

4.2 – EXEMPLOS DE PARES PRIMAL X DUALExemplo 1: Determinar o dual do seguinte modelo de programação linear:

(P) Maximizar z = 6 x1 + 2 x2 + x3

sujeito a:

x1 – x2 + 7 x3 " 4

2 x1 + 3 x2 + x3 " 5

x1 ! 0 , x2 ! 0 , x3 ! 0

Aplicando as regras da dualidade temos que:

(D) Minimizar w = 4 u1 + 5 u2

sujeito a:

u1 + 2 u2 ! 6

– u1 + 3 u2 ! 2

7 u1 + u2 ! 1

u1 ! 0 , u2 ! 0

Exemplo 2: Determinar o dual do seguinte modelo de programação linear, representando graficamenteambos os modelos.

(P) Maximizar z = 3 x1 + 4 x2

sujeito a:

x1 – x2 " – 1

– x1 + x2 " 0

x1 ! 0 , x2 ! 0

D U A L I D A D E E S E N S I B I L I D A D E 1 3 1

Forma Canônica

Forma Padrão

Ou ainda, considerando-se separadamente as forma padrão e canônica:

TABELA 4.2 FORMA PADRÃO E CANÔNICA

Primal Dual

Forma Canônica

Min z = cx

sujeito a:Ax ! b

x ! 0

Max w = ub

sujeito a:uA " c

u ! 0

Forma Padrão

Min z = cx

sujeito a:Ax = b

x ! 0

Max w = ub

sujeito a:uA " c

u # R

4.2 – EXEMPLOS DE PARES PRIMAL X DUALExemplo 1: Determinar o dual do seguinte modelo de programação linear:

(P) Maximizar z = 6 x1 + 2 x2 + x3

sujeito a:

x1 – x2 + 7 x3 " 4

2 x1 + 3 x2 + x3 " 5

x1 ! 0 , x2 ! 0 , x3 ! 0

Aplicando as regras da dualidade temos que:

(D) Minimizar w = 4 u1 + 5 u2

sujeito a:

u1 + 2 u2 ! 6

– u1 + 3 u2 ! 2

7 u1 + u2 ! 1

u1 ! 0 , u2 ! 0

Exemplo 2: Determinar o dual do seguinte modelo de programação linear, representando graficamenteambos os modelos.

(P) Maximizar z = 3 x1 + 4 x2

sujeito a:

x1 – x2 " – 1

– x1 + x2 " 0

x1 ! 0 , x2 ! 0

D U A L I D A D E E S E N S I B I L I D A D E 1 3 1

Page 11: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão !11

Algoritmo Simplex - Implementações

GarantiasNo pior caso, o algoritmo tem complexidade exponencialNa prática, os problemas são resolvidos rapidamenteentre 2m e 3m iterações

“Programas Lineares com milhares ou milhões de variáveissão rotineiramente resolvidos utilizando-se o algoritmo Simplex

com computadores modernos.”

Overton, M.L. 1997

6 / 19 Túlio Toffolo – Otimização Linear e Inteira – Aula 01.2: Simplex e Modelagem

Page 12: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão !12

Algoritmo Simplex - Visão Geral

Lucro $1900

$200

$1400

O algoritmo inicia em algum vérticefactível; ex.: (0,0)

A cada iteração, são pesquisadosvértices vizinhos e o mesmo semove para o que oferecer melhora(método de subida - Hill Climbing);

Sem vizinhos de melhora? Soluçãoé ótima!

3 / 19 Túlio Toffolo – Otimização Linear e Inteira – Aula 01.2: Simplex e Modelagem

Page 13: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão !13

Algoritmo Simplex - Visão Geral

Maximize x1+6x2+13x3

Sujeito a x1 200x2 300

x1+ x2+ x3 400x2+ 3x3 600

x1, x2, x3 � 0

x1

x3

x2

Ótimo

4 / 19 Túlio Toffolo – Otimização Linear e Inteira – Aula 01.2: Simplex e Modelagem

Page 14: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

O Algoritmo Simplex

!14

O Algoritmo Simplex

Passo 1 Converta o PL para a Forma Padrão.Passo 2 Obtenha uma Solução Básica Factível (se

possível) da Forma Padrão.Passo 3 Teste de Otimalidade: Determine se a Solução

Básica é Ótima. Se Ótima PARE.Passo 4 Caso não seja ótima - Mudança de Base:

determine:qual variável não básica irá entrar na base,com o intuito de melhorar a função objetivo;qual variável básica irá sair da base.

Passo 5 Utilize as operações elementares para computar aNova Solução Básica e volte para o Passo 3.

5 / 34 Túlio Toffolo – Otimização Linear e Inteira – Aula 03: Simplex e Modelagem

Page 15: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

O Algoritmo Simplex

Dica: http://www.cos.ufrj.br/splint/

!15

Page 16: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

Dualidade

Page 17: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Formas canônica e padrão

!17

Ou ainda, considerando-se separadamente as forma padrão e canônica:

TABELA 4.2 FORMA PADRÃO E CANÔNICA

Primal Dual

Forma Canônica

Min z = cx

sujeito a:Ax ! bx ! 0

Max w = ub

sujeito a:uA " cu ! 0

Forma Padrão

Min z = cx

sujeito a:Ax = b

x ! 0

Max w = ub

sujeito a:uA " cu # R

4.2 – EXEMPLOS DE PARES PRIMAL X DUALExemplo 1: Determinar o dual do seguinte modelo de programação linear:

(P) Maximizar z = 6 x1 + 2 x2 + x3

sujeito a:

x1 – x2 + 7 x3 " 4

2 x1 + 3 x2 + x3 " 5

x1 ! 0 , x2 ! 0 , x3 ! 0

Aplicando as regras da dualidade temos que:

(D) Minimizar w = 4 u1 + 5 u2

sujeito a:

u1 + 2 u2 ! 6

– u1 + 3 u2 ! 2

7 u1 + u2 ! 1

u1 ! 0 , u2 ! 0

Exemplo 2: Determinar o dual do seguinte modelo de programação linear, representando graficamenteambos os modelos.

(P) Maximizar z = 3 x1 + 4 x2

sujeito a:

x1 – x2 " – 1

– x1 + x2 " 0

x1 ! 0 , x2 ! 0

D U A L I D A D E E S E N S I B I L I D A D E 1 3 1

Forma Canônica

Forma Padrão

Ou ainda, considerando-se separadamente as forma padrão e canônica:

TABELA 4.2 FORMA PADRÃO E CANÔNICA

Primal Dual

Forma Canônica

Min z = cx

sujeito a:Ax ! b

x ! 0

Max w = ub

sujeito a:uA " c

u ! 0

Forma Padrão

Min z = cx

sujeito a:Ax = b

x ! 0

Max w = ub

sujeito a:uA " c

u # R

4.2 – EXEMPLOS DE PARES PRIMAL X DUALExemplo 1: Determinar o dual do seguinte modelo de programação linear:

(P) Maximizar z = 6 x1 + 2 x2 + x3

sujeito a:

x1 – x2 + 7 x3 " 4

2 x1 + 3 x2 + x3 " 5

x1 ! 0 , x2 ! 0 , x3 ! 0

Aplicando as regras da dualidade temos que:

(D) Minimizar w = 4 u1 + 5 u2

sujeito a:

u1 + 2 u2 ! 6

– u1 + 3 u2 ! 2

7 u1 + u2 ! 1

u1 ! 0 , u2 ! 0

Exemplo 2: Determinar o dual do seguinte modelo de programação linear, representando graficamenteambos os modelos.

(P) Maximizar z = 3 x1 + 4 x2

sujeito a:

x1 – x2 " – 1

– x1 + x2 " 0

x1 ! 0 , x2 ! 0

D U A L I D A D E E S E N S I B I L I D A D E 1 3 1

Page 18: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 47 Túlio Toffolo — Otimização Linear e Inteira — Aula 05: Dualidade

Dualidade

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

O dual de um problema de maximização é um problema de minimização.

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

As m restrições primais estão em correspondência com as m variáveis duais.

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

As n restrições duais estão em correspondência com as n variáveis primais.

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

O coeficiente de cada variável na FO, primal ou dual, aparece no outro problema como lado direito da restrição correspondente.

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

A matriz de coeficientes do primal é transposta no dual.

!18

Page 19: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 47 Túlio Toffolo — Otimização Linear e Inteira — Aula 05: Dualidade

DualidadeThe football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Em um problema de minimização….

x* = u*

f(x)

fD(x)

(valor do primal)

(valor do dual)

!19

Page 20: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

DualidadeThe football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Relações entre o primal e o dual:

!20

Ótimo Ilimitado Inviável

Ótimo Possível Nunca Nunca

Ilimitado Nunca Nunca Possível

Inviável Nunca Possível Possível

Page 21: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Transformação Primal x Dual

MIN

Restrição≤ ≤

Variável

MAX

= qq.≥ ≥

Variável≤ ≥

Restriçãoqq. =≥ ≤

!21

Page 22: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

Análise de Sensibilidade

Page 23: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Custo Reduzido

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

O custo reduzido de uma variável é o custo (coeficiente) dela na linha da função objetivo no tableau do Simplex

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

!23

Após Pivoteamento: Nova SBF

0: 5x2 + 10x5 + 10x6 = 280 z = 280

1: � 2x2 + x4 + 2x5 � 8x6 = 24 x4 = 24

2: � 2x2 + x3 + 2x5 � 4x6 = 8 x3 = 8

3: x1 + 1, 25x2 + � 0, 5x5 + 1, 5x6 = 4 x1 = 4

4: x2 + x7 = 5 x7 = 5

Função objetivo: max z = �5x2 � 10x5 � 10x6

Não há mais variáveis atrativas

SOLUÇÃO ÓTIMA (x1, . . . , x3): (2 , 0 , 8)BASE ÓTIMA (x1, . . . , x7): (2 , 0 , 8 , 24 , 0 , 0 , 5)

41 / 48 Túlio Toffolo – Otimização Linear e Inteira – Aula 02: Algoritmo Simplex

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

O custo reduzido é também o shadow price das restrições de não-negatividade

Page 24: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Variáveis de FolgaThe football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

As variáveis de folga indicam restrições ativas e inativas

!24

Após Pivoteamento: Nova SBF

0: 5x2 + 10x5 + 10x6 = 280 z = 280

1: � 2x2 + x4 + 2x5 � 8x6 = 24 x4 = 24

2: � 2x2 + x3 + 2x5 � 4x6 = 8 x3 = 8

3: x1 + 1, 25x2 + � 0, 5x5 + 1, 5x6 = 4 x1 = 4

4: x2 + x7 = 5 x7 = 5

Função objetivo: max z = �5x2 � 10x5 � 10x6

Não há mais variáveis atrativas

SOLUÇÃO ÓTIMA (x1, . . . , x3): (2 , 0 , 8)BASE ÓTIMA (x1, . . . , x7): (2 , 0 , 8 , 24 , 0 , 0 , 5)

41 / 48 Túlio Toffolo – Otimização Linear e Inteira – Aula 02: Algoritmo Simplex

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

As restrições ativas (com variáveis de folga iguais a zero) são as únicas limitando o lucro.

Page 25: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Shadow PriceThe football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Também conhecido como custo dual

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

O shadow price de uma restrição é o valor que a variável dual referente à restrição assume.

Indica o ganho na função objetivo por unidade aumentada no RHS da restrição. O ganho é válido dentro dos limites estabelecidos pelo RHS da restrição.

!25

Page 26: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Allowable increase/decreaseThe football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Indica o aumento/redução permitidos em coeficientes da função objetivo ou no RHS de uma restrição sem que a base deixe de ser ótima!

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

O cálculo é feito tomando como base o custo reduzido (de variáveis primais e duais).

Regra geral:

The football leagues grouping problem

Problem constraints:

Leagues must comprise between m� and m+ teams.At most 2 teams from the same club can be in a league.There is a limit on the level difference between teams inthe same league.There is a limit on the travel time/distance between teamsin the same league.

It’s a generalization of the clique partitioning problem withminimum clique size requirement.

7 / 25 Toffolo et al. – IP heuristics for nesting problems

Pequenas modificações nos dados geralmente não alteram o conjunto de variáveis básicas.

!26

Page 27: Aula 10: Revisão€¦ · / 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão Breve Revisão The football leagues grouping problem Problem constraints:

/ 12/ 27 Túlio Toffolo — Otimização Linear e Inteira — Aula 09: Revisão

Perguntas?

!27