semvec/pypi-packages huggingface dataset:
knapsack 0.3.1
`knapsack` is a package for for solving knapsack problem.
License: Apache-2.0
Requires Python: >=3.11

`knapsack` is a package for solving knapsack problem.

* Maximize sum of selected weight.
* Sum of selected size is less than capacity.
* Algorithm: Dynamic Optimization

## Usage

```python
import knapsack
size = [21, 11, 15, 9, 34, 25, 41, 52]
weight = [22, 12, 16, 10, 35, 26, 42, 53]
capacity = 100
knapsack.knapsack(size, weight).solve(capacity)
```

See also https://pypi.org/project/ortoolpy/

## Requirements

* Python 3

## Setup

```sh
$ pip install knapsack
```

## History

* 0.0.1 (2015-6-26): first release
four-color 0.5.1
`four_color` is a package for Four Color Problem.
License: Apache-2.0
Requires Python: >=3.11

`four_color` is a package for Four Color Problem.

* Download picture from https://raw.githubusercontent.com/SaitoTsutomu/four_color/master/images/sample.png
* `python -m four_color`
* Open http://localhost:8000/
* Set "sample.png" and push "send" button.
* Download "fig.png".

<!-- Attention: Local paths are not displayed in PyPI! -->
![](https://raw.githubusercontent.com/SaitoTsutomu/four_color/master/images/fig.gif)

## Requirements
* Python 3, Pillow, Flask, NetworkX, PuLP

## Setup

```sh
$ pip install four_color
```

## History

* 0.0.1 (2016-6-13): first release
dual 0.3.2
`dual` is a package for dual problem.
License: Apache-2.0
Requires Python: >=3.11

# dual

`dual` is a package for dual problem.

## Installation

```
pip install dual
```

## Example

```python
from dual import dual

print(dual("""\
min c^T x
A x >= b
x >= 0
"""))
```

```
max b^T y
A^T y <= c
y >= 0
```