This Python project implements a genetic algorithm to solve the classic Knapsack Problem, an optimization challenge aiming to maximize the total value of items within a knapsack while adhering to weight constraints, providing a customizable and evolutionary approach to finding optimal or near-optimal solutions in a combinatorial space with a rich history in computer science and mathematics.
-
Genetic Algorithm: The algorithm employs concepts from genetic programming, such as crossover and mutation, to simulate the process of natural selection and evolution.
-
Customizable Parameters: The script allows users to customize various parameters, including population size, crossover type (single-point or n-point), mutation rate, and the number of iterations (epochs).
-
Item Representation: Individual items are represented as objects with profit and weight attributes. Users can provide item information interactively or through a CSV file.
This project is licensed under the MIT License.