Предмет i | wi (вес) | ri (прибыль) |
---|---|---|
1 | 4 | 70 |
2 | 1 | 20 |
3 | 2 | 40 |
Этап 3.
В следующей таблице сравниваются допустимые решения для каждого значения x3
x3 | m3 = 0 | m3 = 1 | m3 = 2 | f3(x3) | m3 |
---|---|---|---|---|---|
0 | 0 | - | - | 0 | 0 |
1 | 0 | - | - | 0 | 0 |
2 | 0 | 40 | - | 40 | 1 |
3 | 0 | 40 | - | 40 | 1 |
4 | 0 | 40 | 80 | 80 | 2 |
5 | 0 | 40 | 80 | 80 | 2 |
6 | 0 | 40 | 80 | 80 | 2 |
Этап 2.
x2 | m2 = 0 | m2 = 1 | m2 = 2 | m2 = 3 | m2 = 4 | m2 = 5 | f1(x2) | m2 |
---|---|---|---|---|---|---|---|---|
0 | 0 + 0 = 0 | - | - | - | - | - | 0 | 0 |
1 | 0 + 0 = 0 | 20 + 0 = 20 | - | - | - | - | 20 | 1 |
2 | 0 + 40 = 40 | 20 + 0 = 20 | 40 + 0 = 40 | - | - | - | 40 | 0 |
3 | 0 + 40 = 40 | 20 + 40 = 60 | 40 + 0 = 40 | 60 + 0 = 60 | - | - | 60 | 1 |
4 | 0 + 80 = 80 | 20 + 40 = 60 | 40 + 40 = 80 | 60 + 0 = 60 | 80 + 0 = 80 | - | 80 | 0 |
5 | 0 + 80 = 80 | 20 + 80 = 100 | 40 + 80 = 120 | 60 + 40 = 100 | 80 + 0 = 80 | 100 + 0 = 100 | 120 | 2 |
6 | 0 + 80 = 80 | 20 + 80 = 100 | 40 + 80 = 120 | 60 + 40 = 100 | 80 + 40 = 120 | 100 + 0 = 100 | 120 | 2 |
Этап 3.
x1 | m1 = 0 | m1 = 1 | f1(x1) | m1 |
---|---|---|---|---|
0 | 0 + 0 = 0 | - | 0 | 0 |
1 | 0 + 20 = 20 | - | 20 | 0 |
2 | 0 + 40 = 40 | - | 40 | 0 |
3 | 0 + 60 = 60 | - | 60 | 0 |
4 | 0 + 80 = 80 | 70 + 0 = 70 | 80 | 0 |
5 | 0 + 120 = 120 | 70 + 20 = 90 | 120 | 0 |
6 | 0 + 120 = 120 | 70 + 40 = 110 | 120 | 0 |
Решение: прибыль равна 120,
(m1, m2, m3) = (0, 0, 3) или (0, 2, 2) или (0, 4, 1) или (0, 6, 0).