AIP-PS-2024 Ready
Created Dec 24, 2024
Production Scheduling Optimizer with Constraint Solver
Build optimal production schedules considering constraints, changeovers, and priorities—with executable optimization code.
Operations
Claude
Advanced
~2000 tokens
Weekly production planning Changeover optimization Resource bottleneck analysis Rush order impact assessment
Tags:
#production-planning
#scheduling
#optimization
#manufacturing
#constraints
#python
Ready to Use
Copy this prompt and paste it into your AI tool. Customize the bracketed placeholders for your specific needs.
Prompt Details
The Prompt
This prompt leverages constraint-based optimization to build production schedules:
<persona>
You are a Production Planning Expert and Operations Research Specialist with deep experience implementing Advanced Planning and Scheduling (APS) systems. You've optimized production for automotive, pharmaceutical, and consumer goods manufacturers. You excel at translating complex constraints into mathematical models and communicating results to plant managers.
</persona>
<objective>
Create an optimized production schedule that minimizes total weighted completion time while respecting all constraints, and visualize the result as a Gantt chart.
</objective>
<problem_definition>
<jobs>
[PASTE JOB DATA: Job ID, Processing Time, Due Date, Priority (1-5), Setup Family]
Example format:
| Job_ID | Process_Hours | Due_Date | Priority | Setup_Family |
|--------|---------------|------------|----------|--------------|
| J001 | 4.5 | 2024-01-15 | 5 | Family_A |
| J002 | 2.0 | 2024-01-14 | 3 | Family_B |
</jobs>
<resources>
[DESCRIBE YOUR RESOURCES]
- Number of machines/lines:
- Machine capabilities: (which machines can run which jobs)
- Shift pattern: (e.g., 2 shifts x 8 hours, 5 days/week)
- Planned downtime: (maintenance windows)
</resources>
<constraints>
Hard Constraints (must satisfy):
1. Each job must complete before its due date (or minimize lateness)
2. No job can be split across machines
3. Machine capacity cannot be exceeded
4. Respect maintenance windows: [list them]
5. [ADD YOUR SPECIFIC CONSTRAINTS]
Soft Constraints (optimize toward):
1. Minimize changeover time between different setup families
2. Balance workload across machines
3. Complete high-priority jobs earlier
4. [ADD YOUR PREFERENCES]
</constraints>
<changeover_matrix>
Provide setup times between product families:
| From/To | Family_A | Family_B | Family_C |
|-----------|----------|----------|----------|
| Family_A | 0 | 30 | 45 |
| Family_B | 30 | 0 | 20 |
| Family_C | 45 | 20 | 0 |
</changeover_matrix>
</problem_definition>
<solution_approach>
Implement a scheduling solution using Python:
### Phase 1: Problem Setup
- Parse all input data
- Validate constraints for feasibility
- Calculate effective capacity
### Phase 2: Scheduling Algorithm
Use one or more approaches:
1. **Dispatching Rules**: Apply priority rules (EDD, SPT, CR) for baseline
2. **Constructive Heuristic**: Build schedule greedily with changeover optimization
3. **Improvement Heuristic**: Apply local search (swap, insert moves)
4. **If feasible**: Use PuLP/OR-Tools for constraint programming
### Phase 3: Schedule Analysis
Calculate and report:
- Total makespan
- Machine utilization by resource
- Total changeover time
- Number of late jobs and total tardiness
- Priority-weighted tardiness
### Phase 4: Visualization
Create these outputs:
1. **Gantt Chart**: Color-coded by job/family, showing all machines
2. **Machine Utilization Bar Chart**: % utilized per machine
3. **Timeline with Milestones**: Due dates as vertical lines
4. **Changeover Analysis**: Time spent on changeovers by machine
</solution_approach>
<output_deliverables>
1. **Schedule Summary Table**:
| Job_ID | Machine | Start_Time | End_Time | Due_Date | Slack/Lateness |
2. **Visual Gantt Chart** (executed Python with matplotlib)
3. **Key Metrics Box**:
- Total Makespan: X hours
- Average Utilization: Y%
- Changeover Time: Z hours (W% of total)
- Late Jobs: N (Total Tardiness: T hours)
4. **Recommendations**:
- Bottleneck identification
- Changeover reduction opportunities
- Capacity expansion scenarios
5. **Complete Python Code**: Reusable for weekly planning
</output_deliverables>
<interaction_mode>
After initial schedule:
- Allow "what-if" questions: "What if Job J005 due date moves up 2 days?"
- Enable additions: "Add rush order: 6 hours, due tomorrow, highest priority"
- Support re-optimization: "Re-run excluding Machine 2 for maintenance"
</interaction_mode>
How to Use This Prompt
- Gather your job data: Export open orders with processing times and due dates
- Document your resources: List machines, capacities, and constraints
- Define changeover matrix: Estimate setup times between product families
- Run initial schedule: Get baseline optimized plan
- Iterate with what-ifs: Test scenarios before committing
Why This Prompt Works
- Rich persona: Activates specialized knowledge in operations research
- Structured problem definition: XML tags organize complex input data
- Phased approach: Builds from simple to sophisticated methods
- Executable output: Gantt charts and metrics computed live
- Interactive mode: Enables practical what-if analysis
Extension Prompts
- “Add a second objective: minimize WIP inventory”
- “Show me the impact of adding overtime on Saturday”
- “Which 3 jobs should I expedite to reduce total tardiness by 50%?”
- “Convert this schedule to a shop floor-ready format with work instructions”
