Sustainable Lean Manufacturing Β· Assembly Line Balancing Β· Operator 4.0
An academically grounded, sustainability-focused, end-to-end decision support system
that includes the operator perspective.
Features β’ Quick Start β’ Architecture β’ CSV Format β’ Algorithms β’ Metrics β’ References
Warning
Beta Software β This application is under active development and is not yet ready for production use. Features may change without notice.
| Tab | Feature | Description |
|---|---|---|
| π₯ Data Input | CSV / Upload / Manual | Load tasks from sample data, upload your own CSV, or enter manually |
| π₯ Data Input | DAG Visualization | Interactive precedence graph with color-coded task durations |
| π Results | RPW Solver | Ranked Positional Weight line balancing (Helgeson & Birnie, 1961) |
| π Results | Greedy Solver | Largest Candidate Rule heuristic |
| π Results | Side-by-Side Compare | Run both algorithms and compare results instantly |
| π Results | Kaizen Simulator | Takt time slider with instant recalculation |
| π Results | Excel Export | Download comprehensive .xlsx report with all results |
| π· Operator JES | Digital Work Instructions | Station-level step-by-step instructions (Operator 4.0) |
| πΏ Sustainability | 9th Waste Analysis | Energy waste (kWh), cost ($), COβ footprint (kg) from idle time |
| βοΈ Compare | Scenario Management | Save, load, and compare scenarios side-by-side with SQLite |
- Python 3.10+
- pip
# Clone the repository
git clone https://github.com/radikonreturn/manufacture-balance.git
cd manufacture-balance
# Install dependencies
pip install -r requirements.txt
# Run the dashboard
python -m streamlit run app.pyOpen your browser at http://localhost:8501
docker-compose up --buildmanufacture-balance/
β
βββ app.py # Main entry point (90 lines)
β
βββ ui/ # π¨ UI Layer
β βββ styles.py # Theme, colors, CSS
β βββ components.py # Reusable widgets (metric cards, DAG, Excel export)
β βββ tabs/ # One module per tab
β βββ input_tab.py # π₯ Data Input
β βββ results_tab.py # π Results & Visualization
β βββ operator_tab.py # π· Digital Operator (JES)
β βββ sustainability_tab.py # πΏ Sustainability Report
β βββ compare_tab.py # βοΈ Scenario Comparison
β
βββ engine/ # βοΈ ALB Engine
β βββ graph.py # Precedence DAG (Directed Acyclic Graph)
β βββ rpw_solver.py # Ranked Positional Weight algorithm
β βββ greedy_solver.py # Largest Candidate Rule algorithm
β βββ metrics.py # Line balancing performance metrics
β βββ energy_waste.py # 9th Waste energy calculator
β βββ jes_generator.py # Electronic Job Element Sheet generator
β
βββ data/ # πΎ Data Layer
β βββ parser.py # CSV parsing & validation
β βββ database.py # SQLite scenario persistence
β
βββ tests/ # π§ͺ Test Suite
β βββ test_engine.py # 22 unit + integration tests
β
βββ sample_tasks.csv # 10-task sample dataset
βββ sample_20_tasks.csv # 20-task sample dataset
βββ sample_30_tasks.csv # 30-task sample dataset
βββ requirements.txt # Python dependencies
βββ Dockerfile # Container build
βββ docker-compose.yml # Container orchestration
task_id,task_name,duration,predecessors
T1,Body Cutting,6,
T2,Hole Drilling,4,T1
T3,Bending,3,T1
T4,Welding A,5,T2
T5,Welding B,4,T2 T3| Column | Type | Description |
|---|---|---|
task_id |
string |
Unique task identifier (e.g. T1, OP_05) |
task_name |
string |
Human-readable task name |
duration |
float |
Task duration in seconds (must be > 0) |
predecessors |
string |
Space-separated predecessor IDs (empty = no dependencies) |
Based on Helgeson & Birnie (1961), the classic line balancing heuristic:
- Compute each task's RPW = own duration + longest successor path
- Sort tasks by descending RPW
- Assign to stations respecting cycle time and precedence constraints
A simpler heuristic that prioritizes larger tasks:
- Sort tasks by descending duration
- For each station, assign the largest eligible task (precedence + capacity OK)
- Open a new station when no more tasks fit
| Metric | Formula | Perfect Score |
|---|---|---|
| Line Efficiency | Ξ£(station loads) / (n Γ CT) Γ 100 | 100% |
| Balance Delay | 100 β Line Efficiency | 0% |
| Smoothness Index | βΞ£(ST_max β ST_i)Β² | 0.0 |
| Theoretical Min Stations | βTotal Work / CTβ | β |
| Bottleneck Score | (station load / CT) Γ 100 | < 90% |
| Energy Waste | idle_time Γ kW/3600 | 0 kWh |
| Carbon Footprint | energy_waste Γ COβ factor | 0 kg |
# Run all 22 tests
python -m pytest tests/ -v
# Lint check (requires ruff)
python -m ruff check . --exclude=".venv,__pycache__"-
Helgeson, W.B. & Birnie, D.P. (1961). Assembly line balancing using the ranked positional weight technique. β RPW algorithm foundation
-
Ciliberto, C. et al. (2021). Exploring lean and green supply chain integration. β "9th Waste" energy waste concept in sustainable manufacturing
-
Ciano, M.P. et al. (2021). One-to-one relationships between Industry 4.0 technologies and Lean production principles. β Operator 4.0 and digital JES integration
MIT License β see LICENSE for details.
Built with β€οΈ for sustainable manufacturing