xXAI-botXx / Genetic-Algorithm

Implementation of Genetic-Algorithm for solution finding (optimization)
Mozilla Public License 2.0
0 stars 0 forks source link

Issue with high search-room #14

Open xXAI-botXx opened 8 months ago

xXAI-botXx commented 8 months ago

The algorithm has problems with the knapsack problem, if the amount of items is high (100) and the capacity is low (20). Because of the random creation and change, the propability, that there is a solution which have a weight under the capacity is not likely and almost not happen.

It helps to add initial (predefined) population (solutions) but it still seems like that the algorithm not works well in this case, because of the propabilities.

The question is:

  1. Can this problem solved in changing parts of the GA algorithm
  2. Is the problem caused of the nature of the GA algorithm? -> no changes to make
  3. Can this problem adressed by changing the implementation of Knappsack -> calculate_fitness, get_random_param_value
  4. How often does this issue occur? By many problems?