Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mehmetaliyuksel/multi-constraint-knapsack-problem

A genetic algorithm based multi-constraint knapsack problem solver
https://github.com/mehmetaliyuksel/multi-constraint-knapsack-problem

knapsack-problem knapsack-problem-genetic knapsack-problem-greedy knapsack-solver

Last synced: 14 days ago
JSON representation

A genetic algorithm based multi-constraint knapsack problem solver

Awesome Lists containing this project

README

        

# Multi-Constraint Knapsack Solver
A genetic algorithm based multi-constraint knapsack problem solver

## Compilation

```bash
$ javac Main.java
```

## Usage

```bash
$ java Main -i
-o
-p
-g
-m
-c
```

## Default Parameters

```
POPULATION_SIZE = 200
NUM_OF_GENERATIONS = 250000
MUTATION_RATE = 0.05
CROSS_OVER_RATE = 0.5
INPUT_FILE = input.txt
OUTPUT_FILE = output.txt
```

## Input Format
Inputs will always be given as a text file. Input file format, using 10 columns, whenever possible, should be as follows:
```
π‘š 𝑛 //
𝑣1 𝑣2 ... 𝑣𝑛 //
π‘Š1 π‘Š2 ... π‘Šπ‘š //
𝑀1,1 𝑀2,1 ... 𝑀𝑛,1 //
𝑀1,2 𝑀2,2 ... 𝑀𝑛,2
................
𝑀1,π‘š 𝑀2,π‘š ... 𝑀𝑛,π‘š
```

## Output Format
Output is a text file including following:
```
Total_Value
π‘₯1
π‘₯2
.
.
.
π‘₯𝑛
```
First line is Total_Value which is the sum of the values of the included items (Σ𝑣𝑖π‘₯𝑖). Next lines include zeros and ones

## Contributors
- [Mehmet Ali YΓΌksel](https://github.com/mehmetaliyuksel)
- [Eymen Topçuoğlu](https://github.com/eymentopcuoglu)