https://github.com/lavantien/go-linear-programming
Linear Programming implement in Go
https://github.com/lavantien/go-linear-programming
golang knapsack linear-programming
Last synced: 8 months ago
JSON representation
Linear Programming implement in Go
- Host: GitHub
- URL: https://github.com/lavantien/go-linear-programming
- Owner: lavantien
- License: mit
- Created: 2023-07-04T19:03:04.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-04T23:38:34.000Z (almost 3 years ago)
- Last Synced: 2025-05-13T20:34:54.416Z (about 1 year ago)
- Topics: golang, knapsack, linear-programming
- Language: HTML
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Linear Programming

## Introduction
- [Linear Programming](https://en.wikipedia.org/wiki/Linear_programming)
- [The Art of Linear Programming](https://youtu.be/E72DWgKP_1Y)
- Find a vector `[b1, b2, ..., bn]`
- That dot product with a vector `[a1, a2, ..., an]` subject to the constraints
- And dot product with a vector `[c1, c2, ..., cn]` maximize a function
## Knapsack Problem
- [Knapsack Problem](https://en.wikipedia.org/wiki/Knapsack_problem)
- A list of objects where each object has a weight and a value: `Object{Weight, Value}`
- Find a binary vector `[b1, b2, ..., bn]`
- Then do dot product with the vector `objects.Weight` with the constraint: `b1 + b2 + ... + bn <= capacity`
- And maximize dot product with the vector `objects.Value`
## Run
```bash
make test
```