Write a Matlab code using Particle Swarm
Optimization (PSO) Algorithm, solve these problems in
.m files, be free to use the builtin functions
1) You have a knapsack that can carry a maximum of 20 pounds.
You can pick from 5 different items to load in your knapsack as
follows:
Item
weight
benefit
Pretzels
2
3
Baked beans
3
4
Peanuts 4
5
Beer
5
8
Canned
ham
9
10
How do you pack the knapsack so that you achieve maximum
benefit?
Solve the following linear problem
2x1 + 2x2 + x3 = 2
x2 + 2x3 = 1
x1 + x2 +
3x3 = 3