背包 Resources

Showing items tagged with "背包"

This MATLAB program solves the 0/1 knapsack problem using genetic algorithm optimization. The algorithm selects items from n available objects to pack into a knapsack with capacity c, where each item i has weight w_i and value p_i. The solution ensures the total weight doesn't exceed capacity while maximizing total value. The implementation includes key genetic operators: crossover, mutation, and selection with fitness evaluation.

MATLAB 257 views Tagged