https://github.com/akphi/vanilla.knapsack
Explore different algorithms for Maximum 0-1 Knapsack
https://github.com/akphi/vanilla.knapsack
3sat dynamic-programming fptas greedy-algorithms knapsack np-complete np-hard
Last synced: about 1 year ago
JSON representation
Explore different algorithms for Maximum 0-1 Knapsack
- Host: GitHub
- URL: https://github.com/akphi/vanilla.knapsack
- Owner: akphi
- Created: 2017-05-07T14:50:16.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-08T01:29:26.000Z (about 9 years ago)
- Last Synced: 2025-03-06T06:04:49.939Z (over 1 year ago)
- Topics: 3sat, dynamic-programming, fptas, greedy-algorithms, knapsack, np-complete, np-hard
- Language: Java
- Homepage:
- Size: 2.76 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vanilla Knapsack and Its Various Flavors

## Introduction ##
This project explores different approach to the familiar Maximum 0-1 Knapsack problem:
* Maximum Value Dynamic Programming
* Minimum Cost Dynamic Programming
* Greedy 2-Approximation
* Fully Polynomial-time Approximation Scheme
As a _side_ experiment, we attempt to reduce 3SAT to Decision 0-1 Knapsack problem.
## Usage
To run the experiment, use the build script. You can modify various run settings by modifying [config.properties](config.properties). This script also helps building the report written in R. To modify the rendering of the report, refer to [configs.R](src/report/configs.R). **Make sure that you run the script directly, i.e. launch it from the directory it belongs to.**
```
./build.sh
```
The report comes in 2 different formats: [PDF](document/report.pdf), HTML (gitbook, bookdown). To view the HTML version, you can view this [file](document/index.html) or for better functionality, we recommend using the start script which serves the HTML files at a local server, i.e. [localhost:2302](localhost:2302), on your machine (with this, you can use the search function within the document).
```
./start.sh
```
The default port is 2302, which can be changed by modifying [configs.R](src/report/configs.R).
## Structure
* **data**: result of the experiments (in CSV and TXT).
* **document**: the [report](document/report.pdf) on result of the experiments.
* **src**: source codes for the project (Java and R).