A REST API built with Python and Flask that solves the Job Shop Scheduling Problem using Google OR-Tools optimization engine.
Given a set of jobs, each consisting of ordered operations to be executed on specific machines, this API finds the optimal schedule that minimizes total completion time (makespan).
- REST API with full CRUD for simulations, jobs and operations
- JWT-based authentication
- Job Shop optimization using Google OR-Tools CP-SAT solver
- Download schedule results as text files (table and plan)
- SQLite database for user management
- Python / Flask
- Google OR-Tools (CP-SAT solver)
- SQLAlchemy + SQLite
- JWT authentication
- Werkzeug password hashing
| Method | Endpoint | Description |
|---|---|---|
| GET | /user |
List all users |
| POST | /user |
Create user |
| PUT | /user/<id> |
Update password |
| DELETE | /user/<id> |
Delete user |
| GET | /login |
Login (returns JWT token) |
| GET | /sims |
List simulations |
| POST | /newsim |
Create simulation |
| DELETE | /deletesim/<id> |
Delete simulation |
| POST | /addoperation/<sim>/<job> |
Add operation to job |
| GET | /jobs |
List all jobs |
| POST | /createtable/<id> |
Validate job table |
| PUT | /updatetable/<job>/<op> |
Update operation |
| GET | /ortools |
Run optimization |
| GET | /downloadtable |
Download process table |
| GET | /downloadplan |
Download manual plan |
| GET | /downloadauto |
Download optimized plan |
pip install flask flask_sqlalchemy werkzeug PyJWT ortools
python src/app.pyAPI will be available at http://localhost:5000
- Create a simulation defining number of machines, jobs and operations
- Add operations to each job (machine + processing time)
- Validate the table is complete
- Call
/ortoolsto get the optimal schedule - Download the result