This project implements a comparison between Dynamic Programming and CollapseGPT algorithms for the 01 Knapsack Problem, based on the "Self-referentially Complete Systems Necessarily Increase Entropy" axiom.
A Python virtual environment has been set up with all required dependencies:
# Activate the environment
source knapsack_env/bin/activate
# Or use the convenience script
./activate_env.shThe following packages are installed in the virtual environment:
- numpy (2.3.1)
- matplotlib (3.10.3)
- seaborn (0.13.2)
- pandas (2.3.1)
- tqdm (4.67.1)
See requirements.txt for the complete list with exact versions.
# Make sure virtual environment is activated
source knapsack_env/bin/activate
# Run the experiment
python knapsack_collapse_experiment.pyThe experiment generates:
knapsack_comprehensive_analysis.png- Complete visualization analysiscase_study.png- Detailed case studyknapsack_experiment_results.csv- Raw experimental data
The experiment runs comparisons across different problem sizes (20, 50, 100, 200, 500 items) and shows:
- Speedup: CollapseGPT is ~360x faster on average
- Approximation: Achieves ~91% of optimal value
- Scalability: O(n log n) vs O(nW) complexity
- Memory: Minimal memory usage vs O(nW) for DP
To deactivate the virtual environment:
deactivate