solve_scheduling_problem
Solve task scheduling problems with dependencies and resource constraints, optimizing for makespan, cost, or lateness.
Instructions
Solve a task scheduling problem with dependencies and resource constraints.
This is a high-level interface for scheduling problems. Use this instead of solve_constraint_model when you have tasks with durations, dependencies, and resource constraints. The solver automatically builds the appropriate CP-SAT model.
Args: tasks: List of Task objects to schedule (id, duration required; dependencies, resources, etc. optional) resources: Optional list of Resource objects with capacity constraints objective: SchedulingObjective enum (MINIMIZE_MAKESPAN, MINIMIZE_COST, or MINIMIZE_LATENESS) max_time_ms: Maximum solver time in milliseconds (default 60000)
Returns: SolveSchedulingProblemResponse containing: - status: Solution status - makespan: Project completion time - schedule: List of task assignments with start/end times - resource_utilization: Resource usage summary - critical_path: Task IDs on critical path - solve_time_ms: Actual solve time - optimality_gap: Gap from best bound - explanation: Human-readable summary
Tips for LLMs: - Extract task durations from natural language (e.g., "takes 2 hours" -> duration: 2) - Parse dependencies carefully (e.g., "A before B" -> B depends on A) - Default resource capacity to system constraints if not specified - If user says "as fast as possible", use minimize_makespan - Check for circular dependencies before solving - If infeasible, check for conflicting deadlines or impossible dependencies
Example (simple project schedule):
python response = await solve_scheduling_problem( tasks=[ {"id": "build", "duration": 10, "dependencies": []}, {"id": "test", "duration": 5, "dependencies": ["build"]}, {"id": "deploy", "duration": 3, "dependencies": ["test"]} ], objective="minimize_makespan" ) # Returns optimal schedule with makespan = 18
Example (with resource constraints):
python response = await solve_scheduling_problem( tasks=[ {"id": "task_a", "duration": 5, "resources_required": {"cpu": 2}}, {"id": "task_b", "duration": 3, "resources_required": {"cpu": 3}}, ], resources=[{"id": "cpu", "capacity": 4}], objective="minimize_makespan" ) # Returns schedule respecting CPU capacity
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tasks | Yes | ||
| objective | No | minimize_makespan | |
| resources | No | ||
| max_time_ms | No |