Math & Numbers
Balanced transportation problems as min-cost flow: successive shortest paths, MODI duals, reduced-cost optimality certificate, and full shipping plan.
Call this tool from your code in three languages.
curl -X POST 'http://127.0.0.1:3003/en/api/tools/transportation-problem' \
-H 'Content-Type: application/json' \
-d '{"costs":"2, 3, 1, 4\n4, 2, 5, 3\n3, 1, 4, 2","supply":"30, 40, 30","demand":"20, 30, 30, 20","decimalPlaces":4}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST http://127.0.0.1:3003/en/api/tools/transportation-problem| Name | Type | Required | Description |
|---|---|---|---|
| costs | textarea | Yes | Unit shipping cost from each source (row) to each destination (column). 2–8 rows × 2–8 columns. |
| supply | text | Yes | Amount available at each source, one per matrix row (non-negative). |
| demand | text | Yes | Amount required at each destination, one per matrix column (non-negative). |
| decimalPlaces | number | No | — |
Text result
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-transportation-problem": {
"name": "transportation-problem",
"description": "Balanced transportation problems as min-cost flow: successive shortest paths, MODI duals, reduced-cost optimality certificate, and full shipping plan.",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=transportation-problem",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "transportation-problem",
"arguments": {
"costs": "2, 3, 1, 4\n4, 2, 5, 3\n3, 1, 4, 2",
"supply": "30, 40, 30",
"demand": "20, 30, 30, 20",
"decimalPlaces": 4
}
}
}Questions or issues? Contact [email protected]