Find the correct fitness function for optimization using Differential Evolution for budgeting problem

i am building a website for recommendation system using differential evolution. The website will ask the user's budget and some criteria and will return the optimal package. The data field look like this and i have 8 dimensions (tables).

Id | Name | Price
1  | A    | $100
2  | B    | $300

So far i have come up with this equation:

f = 1/abs(budget-x1-x2-x3-x4-x5-x6-x7-x8)+1
abs=(absolute)
x1 = 1st Dimension $ price
x2 = 2nd Dimension $ price
and so on

The +1 at the end is to not be divided by zero, so f=1 would be the best cost/score.

I've tried this formula and if it can't find f=1 then the cost would give bad result.

Someone have a better solution or any literature close to this type of problem ?

Thanks in advance

Upvotes: 1

Views: 120

Answers (1)

Matthew Woodruff
Matthew Woodruff

Reputation: 453

So, DE is a great evolutionary algorithm. DE is fairly simple, on the one hand, while also being reasonably powerful.

However, this problem is a classic integer linear programming problem -- the objective is linear in the variables, and there are no constraints. Integer linear programming is going to go so much faster than any evolutionary algorithm. I'd look at pyomo or glpk for open source ILP solvers.

Upvotes: 0

Related Questions