Elysia Tools Docs
EN
Language
ZHESPTRUFRDEEN
Back to site
Browse tools

Math & Numbers

Transportation Problem Solver (Min-Cost Flow)

Balanced transportation problems as min-cost flow: successive shortest paths, MODI duals, reduced-cost optimality certificate, and full shipping plan.

text· Text resultOpen tool

Quick start

Call this tool from your code in three languages.

cURL
curl -X POST 'https://api.elysiatools.com/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}'

API reference

Send a POST request with your inputs as JSON. File parameters require a separate upload first.

Endpoint

HTTP
POST https://api.elysiatools.com/en/api/tools/transportation-problem

Parameters

NameTypeRequiredDescription
coststextareaYesUnit shipping cost from each source (row) to each destination (column). 2–8 rows × 2–8 columns.
supplytextYesAmount available at each source, one per matrix row (non-negative).
demandtextYesAmount required at each destination, one per matrix column (non-negative).
decimalPlacesnumberNo—

Response format

Text result

JSON
{
  "result": "Processed text content",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}

MCP integration

Add this tool to your Model Context Protocol server so AI agents can list and call it.

Server configuration

Add this block to your MCP client configuration:

mcp.json
{
  "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": "https://api.elysiatools.com/mcp/sse?toolId=transportation-problem",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

List available tools

After connecting to the SSE endpoint, list the exposed tools:

tools/list
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

Call this tool

Invoke the tool by its id, passing arguments built from its parameters:

tools/call
{
  "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
}
  }
}
Chain multiple tools in one session with a comma-separated toolId list, e.g. /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp (max 20).

Questions or issues? Contact [email protected]

Browse toolsOpen tool

© 2026 Elysia Tools. Developer documentation.

Back to siteBrowse tools