mochila
DESCRIPTION
Ejercicio de la mochila de Taha 7a ed.TRANSCRIPT
Ejemplo 10,3-1
Peso Barco W= 4Peso Unitario wi= ToneladasIngreso por Unidad ri= miles Dolares
Articulo i wi ri1 2 312 3 473 1 14
Se asume que:Los estados X3= 0 ←Caso extremo de NO asignar nungun articulo 3 en el BarcoLos estados X3= 4 ←Caso extremo de asignar al barco toda la capacidad
Como:w3= 1 4/1= 4 (cada articulo pesa 1, y la capacidad maxima es de 4 entonces se pueden llevar maximo 4)
↑ lo que significa que los valores posibles de m3= 0,1,2,3,4
Alternativas factibles Alternativas no factiblesw3 m3 > x3
Etapa 3 Comparar las alternativas
F3(x3)= Max (14m3), Max (m3) = (4/1) = 4
14 m3 Solucion optimax3 m3=0 m3=1 m3=2 m3=3 m3=4 f3(x3) m3*0 0 - - - - 0 01 0 14 - - - 14 12 0 14 28 - - 28 23 0 14 28 42 - 42 34 0 14 28 42 56 56 4
Etapa 2
F2(x2)= Max (47m2 + F3(x2-3m2)). Max (m2) = 4/3 = 1
47m2 + F3(x2-3m2) Solucion optimax2 m2=0 m2=1 f2(x2) m2*0 0 - 0 01 14 - 14 02 28 - 28 03 42 47 47 14 56 61 61 1
w3 m3 ≤ x3
(cada articulo pesa 1, y la capacidad maxima es de 4 entonces se pueden llevar maximo 4)
Dymamic Programing (Backward) Knapsack ModelInput Data and Stage Calculations Ouput Solution Summary
Number of stages,N= res, limit, W= <<Maximu x fCurrent stage= W= r=are m-values correct?
m=r”m=
w”m=
Dymamic Programing (Backward) Knapsack ModelInput Data and Stage Calculations Ouput Solution Summary
Number of stages,N= res, limit, W= 4 <<Maximustage Optiman Sx fCurrent stage= 3 w3= 1 r3= 14are m-values correct? yes yes yes yes yes
stage4m= 0 1 2 3 4
r3”m3= 0 14 28 42 56f4 w3”m3= 0 1 2 3 4
x3= 0 0 14 111111 111111 111111x3= 1 0 14 111111 111111 111111x3= 2 0 14 28 111111 111111x3= 3 0 14 28 42 111111x3= 4 0 14 28 42 56
Dymamic Programing (Backward) Knapsack ModelInput Data and Stage Calculations Ouput Solution Summary
Number of stages,N= res, limit, W= 4 <<Maximu x fCurrent stage= 2 w2= 3 r2= 47 stage 3are m-values correct? yes yes 0 0
stage 3m= 0 1 1 14
r2”m2= 0 47 2 28f3 w2”m2= 0 3 3 42
0 x2= 0 0 0 111111 4 5614 x2= 1 14 14 11111128 x2= 2 28 28 11111142 x2= 3 42 42 4756 x2= 4 56 56 61
44444Dymamic Programing (Backward) Knapsack Model
Input Data and Stage Calculations Ouput Solution Summary
stage Optiman Solution
stage Optiman Solution
𝐴=𝜋𝑟^2
Number of stages,N= 3 res, limit, W= 4 <<Maximu x fCurrent stage= 1 w1= 2 r1= 31 stage 3are m-values correct? yes yes yes 0 0
stage 2m= 0 1 1 14
r2”m2= 0 47 2 28f3 w2”m2= 0 3 3 42
0 x1= 0 0 111111 111111 0 0 4 5614 x1= 1 14 111111 111111 14 028 x1= 2 28 31 111111 31 147 x1= 3 47 45 111111 47 061 x1= 4 61 59 62 62 2
stage Optiman Solution
Dymamic Programing (Backward) Knapsack ModelOuput Solution Summary Articulo i peso valor
m x f m Articulo i wi ri1 2 312 3 473 1 14
92
Dymamic Programing (Backward) Knapsack ModelOuput Solution Summary
m x f m
Dymamic Programing (Backward) Knapsack ModelOuput Solution Summary
m x f mstage 3 stage 2
0 0 0 01 1 14 02 2 28 03 3 47 14 4 61 1
Dymamic Programing (Backward) Knapsack ModelOuput Solution Summary
𝐴=𝜋𝑟^2
m x f mstage 3 stage 2
0 0 0 01 1 14 02 2 28 03 3 47 14 4 61 1
stage 10 0 01 14 03 47 04 62 2