Skip to content

This project offers a Python implementation of a genetic algorithm to solve the knapsack problem, a combinatorial optimization challenge aimed at maximizing the total value of items within a knapsack while adhering to weight constraints.

License

Notifications You must be signed in to change notification settings

HomaTaherpour/Knapsack-Problem-Using-Genetic-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm For Knapsack Problem

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.

Features

  • 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.

License

This project is licensed under the MIT License.

About

This project offers a Python implementation of a genetic algorithm to solve the knapsack problem, a combinatorial optimization challenge aimed at maximizing the total value of items within a knapsack while adhering to weight constraints.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages