Factory Operations Research & Optimisation Library
Project description
factory-optimizer
Factory Operations Research & Optimisation Library
A Python library that solves real factory operations problems using proven OR (Operations Research) techniques. Give it your factory data — materials, costs, supply, demand — and it returns the mathematically optimal plan.
Install
pip install factory-optimizer
Quick Start
from factory_optimizer import FactoryOptimizer
fo = FactoryOptimizer()
# A welcome guide prints automatically on first import!
What it solves
| Problem | Method | Function |
|---|---|---|
| Production Planning | Linear Programming (Simplex) | optimize_production() |
| Transportation / Distribution | Vogel's Approximation (VAM) | optimize_transportation() |
| What-if analysis | Scenario simulation engine | simulate_production() / simulate_transportation() |
Usage
1. Production Planning
result = fo.optimize_production(
resources={"material_A": 500, "material_B": 300},
products={
"prod_1": {"materials": {"A": 2, "B": 1}, "profit": 50},
"prod_2": {"materials": {"A": 1, "B": 2}, "profit": 40},
},
report=True # prints a formatted console report
)
print(result["quantities"]) # {"prod_1": 233.33, "prod_2": 33.33}
print(result["total_profit"]) # 13000.0
2. Transportation Planning
result = fo.optimize_transportation(
supply={"Factory_1": 100, "Factory_2": 150},
demand={"Customer_1": 80, "Customer_2": 120, "Customer_3": 50},
cost_matrix=[[4, 6, 8],
[5, 4, 3]],
report=True
)
print(result["total_cost"]) # 990.0
print(result["plan"]) # {"Factory_1": {"Customer_1": 80, ...}, ...}
3. Scenario Simulation
sim = fo.simulate_production(
resources={"material_A": 500, "material_B": 300},
products={
"prod_1": {"materials": {"A": 2, "B": 1}, "profit": 50},
"prod_2": {"materials": {"A": 1, "B": 2}, "profit": 40},
},
scenarios=[
{
"name": "Material A supply +20%",
"changes": {
"resources": {"material_A": {"delta": 20, "mode": "percent"}}
}
},
{
"name": "Prod_1 profit +$10",
"changes": {
"products": {"prod_1": {"profit": {"delta": 10, "mode": "absolute"}}}
}
},
],
report=True
)
Requirements
- Python >= 3.8
- scipy >= 1.7.0
- numpy >= 1.21.0
License
MIT
Project details
Release history Release notifications | RSS feed
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 factory_optimizer-1.0.0.tar.gz.
File metadata
- Download URL: factory_optimizer-1.0.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32079656e69e2f0ab8823a17fbf18e2cd0903850baf5dc2073744a64759218be
|
|
| MD5 |
1ef906446588b3932df98928a9ef935c
|
|
| BLAKE2b-256 |
468202f51b369baf09d1804b67e03590dbe2fd79c391aa33cc7c5a3972858420
|
File details
Details for the file factory_optimizer-1.0.0-py3-none-any.whl.
File metadata
- Download URL: factory_optimizer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8803c0bd86523d3949ed6d9b200882be48380dc3722b20891a695be289679332
|
|
| MD5 |
0147928964fd4b6e9e8b981f16a84554
|
|
| BLAKE2b-256 |
53cb5e9a300a56b69a487b06dc77c490b9b438ae7996c4324cb0ee6ed4f29e87
|