Ferramenta para visualização gráfica e resolução de modelos de Programação Linear em duas variáveis, incluindo simplex e zona viável.
Project description
LPKit 📊
LPKit é uma biblioteca Python para visualização e resolução de modelos de Programação Linear.
Ideal para fins didáticos, acadêmicos ou aplicações simples com:
✅ Região factível (método gráfico)
✅ Vetor gradiente e curvas de nível
✅ Método Simplex
✅ Ponto ótimo e valor da função objetivo
✨ Instalação
pip install lpkit
Ou para desenvolvimento local:
git clone https://github.com/pedroeckel/lpkit.git
cd lpkit
pip install -e .
🚀 Exemplo de uso: método gráfico e Simplex
from lpkit import solve_with_graphics
model_text = '''
Max Z = 5*x1 + 2*x2
x1 <= 3
x2 <= 4
x1 + 2*x2 <= 9
x1 - 2*x2 <= 2
x1 >= 0
x2 >= 0
'''
solve_with_graphics(model_text, verbose={
"show_gradient": True,
"show_level_curves": True,
"show_objective_value": True,
"show_vertex_points": True,
"show_optimal_point": True
})
🧠 Exemplo de uso: método Simplex
from lpkit import solve_with_simplex
model_text = '''
Max Z = 5*x1 + 2*x2
x1 <= 3
x2 <= 4
x1 + 2*x2 <= 9
x1 - 2*x2 <= 2
x1 >= 0
x2 >= 0
'''
solve_with_simplex(model_text, verbose={
"simplex_tableau": True,
"entering_leaving": True,
"pivot": True,
"basic_vars": True,
"constraints_validation": True,
"z_per_iteration": True,
"history_summary": True
})
📄 Licença
Distribuído sob a Licença MIT.
🤝 Contribuindo
Pull requests são bem-vindos!
Se quiser sugerir melhorias ou reportar bugs, abra uma issue.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lpkit-0.2.1.tar.gz.
File metadata
- Download URL: lpkit-0.2.1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364c3e2a403fbdc6520aa06970d4aaf1cedbf09feae5ca4e106e925ee557b145
|
|
| MD5 |
ef14f8afc32f0c55b5beb823903a2b3a
|
|
| BLAKE2b-256 |
60de5c72cd06c3ec5cceeb11d0645333ec3ddc42ef6ef5326506ed1edcdd61fd
|
File details
Details for the file lpkit-0.2.1-py3-none-any.whl.
File metadata
- Download URL: lpkit-0.2.1-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ba0f63709e716b39c47f3001c805e01179034e12136c434ac77a54ba91d2d71
|
|
| MD5 |
84b7574a789e765bf529ba9f470fcfc1
|
|
| BLAKE2b-256 |
e322adc28e18b19cc191914988775dcccbafcb795faac525864c3f7c57bd3ad7
|