Está en la página 1de 16

Ejemplo 10,3-1

Peso Barco
W=
4
Peso Unitario wi= Toneladas
Ingreso por Unidad ri= miles Dolares
Articulo i
1
2
3

wi
2
3
1

ri
31
47
14

Se asume que:
Los estados X3= 0
Los estados X3= 4

Caso extremo de NO asignar nungun articulo 3 en el Barco


Caso extremo de asignar al barco toda la capacidad

Como:
w3= 1

(cada articulo pesa 1, y la capacidad maxima es de 4 entonces se puede

4/1= 4

lo que significa que los valores posibles de m3= 0,1,2,3,4


Alternativas factibles
w3 m3 x3
Etapa 3

Alternativas no factibles
w3 m3 > x3

Comparar las alternativas


F3(x3)= Max (14m3), Max (m3) = (4/1) = 4
14 m3

x3
0
1
2
3
4

m3=0
0
0
0
0
0

m3=1
14
14
14
14

m3=2
28
28
28

m3=3
42
42

Etapa 2
F2(x2)= Max (47m2 + F3(x2-3m2)). Max (m2) = 4/3 = 1

x2
0
1

47m2 + F3(x2-3m2)
m2=0
m2=1
0
14
-

Solucion optima
f2(x2)
m2*
0
0
14
0

m3=4
56

2
3
4

28
42
56

47
61

28
47
61

0
1
1

ulo 3 en el Barco
capacidad

a es de 4 entonces se pueden llevar maximo 4)

Solucion optima
f3(x3)
m3*
0
0
14
1
28
2
42
3
56
4

Number of stages,N=
Current stage=
are m-values correct?

Dymamic Programing (Backward) Knapsack Model


Input Data and Stage Calculations
res, limit, W=
<<Maximum
W=
r=

m=
rm=
wm=

Number of stages,N=
Current stage=
are m-values correct?
stage4
f4
x3=
x3=
x3=
x3=
x3=

Number of stages,N=
Current stage=
are m-values correct?
stage 3
f3
0 x2=
14 x2=
28 x2=
42 x2=
56 x2=

Dymamic Programing (Backward) Knapsack Model


Input Data and Stage Calculations
res, limit, W=
4 <<Maximum
3 w3=
1 r3=
14
yes
yes
yes
yes
yes
m=
0
1
2
3
4
r3m3=
0
14
28
42
56
w3m3=
0
1
2
3
4
0
0
14
111111
111111 111111
1
0
14
111111
111111 111111
2
0
14
28
111111 111111
3
0
14
28
42 111111
4
0
14
28
42
56

Dymamic Programing (Backward) Knapsack Model


Input Data and Stage Calculations
res, limit, W=
4 <<Maximum
2 w2=
3 r2=
47
yes
yes
m=
0
1
r2m2=
0
47
w2m2=
0
3
0
0
0
111111
1
14
14
111111
2
28
28
111111
3
42
42
47
4
56
56
61

44444
Dymamic Programing (Backward) Knapsack Model
Input Data and Stage Calculations

Number of stages,N=
Current stage=
are m-values correct?
stage 2
f3
0 x1=
14 x1=
28 x1=
47 x1=
61 x1=

3 res, limit, W=
1 w1=
2 r1=
yes
yes
yes
m=
0
1
r2m2=
0
47
w2m2=
0
3
0
0 111111
111111
1
14 111111
111111
2
28
31
111111
3
47
45
111111
4
61
59
62

4 <<Maximum
31

ard) Knapsack Model


x

Ouput Solution Summary


f
m
x
f
m

stage Optiman
Solution

ard) Knapsack Model


Ouput Solution Summary
stage Optiman Sx
f
m
x
=
^2

ard) Knapsack Model


Ouput Solution Summary
x
f
m
x
stage 3
0
0
0
stage Optiman
Solution
1
14
1
2
28
2
3
42
3
4
56
4

ard) Knapsack Model


Ouput Solution Summary

f
m
stage 2
0
0
1
14
2
28
3
47
4
61

0
0
0
1
1

x
stage Optiman
Solution

0
14
31
47
62

0
0
1
0
2

f
m
stage 3
0
0
1
14
2
28
3
42
4
56

x
0
1
2
3
4

f
m
stage 2
0
0
1
14
2
28
3
47
4
61
stage 1
0
0
1
14
3
47
4
62

0
0
0
1
1
0
0
0
2

Articulo i
Articulo i
1
2
3

peso

valor
wi
2
3
1

ri
31
47
14
92

También podría gustarte