Instituut voor Milieuvraagstukken
Discussion
Started 5 January 2021
How to design a flexible knapsack genetic algorithm for economics ?
Hi,
Ok so I'm all new to computer science and metaheuristics, and need to implement multi-objective optimization for an environemental economics problem with real world data.
The problem goes as this :
I have a large set of possible locations for an infrastructure within a city. Each location provides two benefits A and B, as well as costs (more benefits may be added in the future, depending on further research). Data points are unrelated, cost and benefit functions are not linear and not continuous.
I need a method for selecting a handful of locations that maximizes simultaneously A and B, under the constraint that the total costs < a budget parameter.
I went towards genetic algorithm (GA) for this problem, as it is is highly combinatorial, but I am facing the fact that most "traditional" GA I've looked at have fixed chromosome lengths, and ultimately only give out final individuals of n items. In my case, i am quite flexible on the quantity of best locations, as long as it either minimizes total costs, or handles it as a constraint. As a matter of fact, it would be quite interesting to have as a final result a pareto-front of individuals of different size (for example : in my problem, locations in city center have more "value" than locations in periurban areas, so a few centric locations could be as pareto-optimal as more numerous periurban locations). So I see the problem as a knapsack problem, where costs would be the "weight"; however there can't be any repetition of items here (a same location cannot be used twice).
Is there a way to handle costs constraint as to make a knapsack genetic algorithm that can provide a pareto front of individuals of heteogeneous length. I have been trying it with DEAP library but don't really find details in its documentation.
Many thanks
Georges Farina
Most recent answer
Thank you for your various answers
Przemysław Kowalik cost and benefit are location-specific empirical data, computed from hydrogeological studies and further economic research.
William Wolfe Though can such a method provide a final diverse pareto front of solutions ? I suppose the mutation probability rate is a crucial parameter for deviating from local optimas ? Any reference on how to set it" correctly" ?
All replies (5)
Badji Mokhtar University
Dear Georges Farina,
I suggest you to see links anattached files on topic.
https://www.dataminingapps.com/2017/03/solving-the-knapsack-problem-with-a-simple-genetic-algorithm/
Best regards
1 Recommendation
National Council for Scientific Research, Lebanon
Knapsack problems of economic type can be easily solved by Genetic algorithm see the following sites for an example of knapsack business problems:
Knapsack Problem Using Genetic Algorithm With Source Code | by Muzamil Shahbaz | Medium
Genetic algorithm for knapsack problem in Matlab - Free Open Source Codes - CodeForge.com
1 Recommendation
Lublin University of Technology
Georges Farina what do you mean by "cost and benefit functions are not linear and not continuous"? What is the variable on what both cost and benefit depend?
GBL Systems Corporation
A simple first approach is to number your objects 1 to n and use a random binary n- vector (e.g.: <0,1, 0, 0, 1, 0,1, 1>) to indicate which objects are placed in the sack ( 0 = not, 1 = yes). Score the vector by giving it a large negative score if the chosen objects don't fit into the sack, and a score equal to the sum of their values if they do. Then generate a random population of m vectors (n-long) and rank them by their score. Then select two parents (explore various methods for Selection), do a simple binary vector crossover to create children, then score the children and place them in the population (probably by replacing the bottom two members of the population). Re-sort and iterate. Throw in some random mutations to the population at each iteration (explore small to large mutation rates). There are many possible variations, the first thought is to try to have only "feasible" members in the population (that is, try to eliminate the n-vectors that represent a set of objects that don't fit into the sack) -- but, the evolution process will probably take care of that.
Instituut voor Milieuvraagstukken
Thank you for your various answers
Przemysław Kowalik cost and benefit are location-specific empirical data, computed from hydrogeological studies and further economic research.
William Wolfe Though can such a method provide a final diverse pareto front of solutions ? I suppose the mutation probability rate is a crucial parameter for deviating from local optimas ? Any reference on how to set it" correctly" ?
Similar questions and discussions
Besides Goldberg, has anyone already published a generalization for the schema theorem?
- Lauro Cássio Martins de Paula
It is possible to find out several authors in the literature that have used the schema theorem to solve or justify some optimization problem. However, in general, it is also possible to realize that even the generalization of the schema theorem (proposed by Goldberg, 2002) is not sufficient to demonstrate, for instance, the superiority of genetic algorithms over other evolutionary algorithms. Indeed, one of the main reasons consists on the disruption of the building blocks caused by crossover operators.
In this sense, what do you think about that?
Conference Paper Variable Selection for Multivariate Calibration in Chemometr...
Related Publications
Most metaheuristics define a set of parameters that must be tuned. A good setup of those parameter values can lead to take advantage of all the metaheuristic capabilities to solve the problem at hand. Tuning techniques are step by step methods based on multiple runs of the algorithm. In this study we compare three automated tuning methods: F-Race,...
Scheduling is a hard problem due to much considerations in many goals. Combination of goals in this scheduling cause the problem hard to solve even when using mathematical techniques. Optimization is a method which aim to achieve the best result with the least cost as possible. Optimization for large scale problem usually done with more modern tech...
The search for logistics best-practices in international trade has led to the appearance of the Berth Allocation Problem. If the vessels have release dates, the problem is proved to be NP-hard and the performance of exact algorithms is not satisfactory, leading to the use of metaheuristics. This paper develops a Hybrid Evolutionary Algorithm for th...