Solve Linear Program Tool
solve_linear_program_toolSolve linear and mixed-integer programs by defining objectives, variables, and constraints to optimize resource allocation, production, diets, investments, or logistics.
Instructions
Solve a linear programming problem using PuLP.
This tool solves general linear programming problems where you want to optimize a linear objective function subject to linear constraints.
Use cases:
Resource allocation: Distribute limited resources optimally
Diet planning: Create nutritionally balanced meal plans within budget
Manufacturing mix: Determine optimal product mix to maximize profit
Investment planning: Allocate capital across different investment options
Supply chain optimization: Minimize transportation and storage costs
Energy optimization: Optimize power generation and distribution
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"objective": "<objective>",
"variables": "<variables>",
"constraints": "<constraints>"
},
"name": "solve_linear_program_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| solver | No | Solver to use ("CBC", "GLPK", "GUROBI", "CPLEX"); the requested solver must be available or the call fails - no silent fallback | CPLEX |
| objective | Yes | Objective function with 'sense' ("minimize" or "maximize") and 'coefficients' (dict mapping variable names to coefficients) | |
| variables | Yes | Variable definitions mapping variable names to their properties (type: "continuous"/"integer"/"binary", lower: bound, upper: bound) | |
| constraints | Yes | List of constraints, each with 'expression' (coefficients), 'operator' ("<=", ">=", "=="), and 'rhs' (right-hand side value) | |
| time_limit_seconds | No | Maximum time to spend solving (optional) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||