Can I use Swarm Optimization to solve a constrained Linear Program?

Trying to learn a little bit about AI, and was curious
if there's a way to use the Swarm Optimization Algorithm
to solve a constrained Linear Program.

Who is Participating?
Ah yes, Your problem is related to the knapsack problem so there is no efficient way to get a guaranteed optimal solution. (Finding the optimal solution would basically require trying every possible combination). This looks like a great problem for a particle swarm. You have a complex, multidimension problem space, but there will potentially be multiple sizeable areas with good solutions.
If you are referring to Particle Swarm Optimization and a Constrained Linear Least-Squares Problem, then I would say sure. You could solve it with PSO; however, there are other methods which are much faster, more consistent, and more guaranteed.
PSO is an optimization method and is usually used when there is no known solution and a 'close enough' solution will suffice. There is no guarantee of finding the best solution (although with a linear problem, you'd most likely hit the optimal solution). PSO also takes much longer than the direct approaches (for this particular problem).
PSO is a heuristic and is usually only used if no known (efficient) algorithm exists.
JustinWAuthor Commented:
I'm trying to set up a way to combine foods to create a "recepie"
that satisfies certain constraints and minimizes, or maxamizes an
arbitrary property.

(Say I want to combine chicken, beans, and rice, and olive oil
so that I have
50 grams of carbohydrates,
50 grams of protein,
22 grams of Fat,
a max of 12 grams of rice
minimizing the function on price)

I think that this is actually what george danzig developed the
linear programming method for. The reason I'm looking at either
PSO or GA is in part to learn it, and in part because if its not
substantially slower than simplex, it appears to be substantially
easier to code than say Mixed Integer Optimization.

JustinWAuthor Commented:
Way over my head, but definitely looks like some thought has gone into how to solve
this type of problem...

Chapter 2

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.