Network flow feasibility check

network-flow-feasibility-check · version 1.0.0 · Numbers & math · free, no key needed

Check a claimed s-t flow for capacity bounds and conservation with exact integers; returns the first bad edge or node.

Use when you need to: check if a network flow is feasible · verify flow conservation at every node · validate edge flows against capacities.

Decide before calling

Read the versioned contract and the supported scope below. Reuse network-flow-feasibility-check@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use network-flow-feasibility-check@1.0.0 for check if a network flow is feasible. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "nodes": [
    "s",
    "v1",
    "v2",
    "v3",
    "v4",
    "t"
  ],
  "edges": [
    {
      "from": "s",
      "to": "v1",
      "capacity": 16
    },
    {
      "from": "s",
      "to": "v2",
      "capacity": 13
    },
    {
      "from": "v2",
      "to": "v1",
      "capacity": 4
    },
    {
      "from": "v1",
      "to": "v3",
      "capacity": 12
    },
    {
      "from": "v3",
      "to": "v2",
      "capacity": 9
    },
    {
      "from": "v2",
      "to": "v4",
      "capacity": 14
    },
    {
      "from": "v4",
      "to": "v3",
      "capacity": 7
    },
    {
      "from": "v3",
      "to": "t",
      "capacity": 20
    },
    {
      "from": "v4",
      "to": "t",
      "capacity": 4
    }
  ],
  "source": "s",
  "sink": "t",
  "claim": {
    "flows": [
      11,
      8,
      1,
      12,
      4,
      11,
      7,
      15,
      4
    ],
    "value": 19
  }
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "first_discrepancy": null,
    "flow_value": "19",
    "reference_version": "CLRS 4th ed. (2022) ch. 24 Maximum Flow: flow networks, cuts, residual networks, max-flow min-cut theorem; r55-flow-certificate-verifiers@1.0.0"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "network-flow-feasibility-check",
  "version": "1.0.0",
  "input": {
    "nodes": [
      "s",
      "v1",
      "v2",
      "v3",
      "v4",
      "t"
    ],
    "edges": [
      {
        "from": "s",
        "to": "v1",
        "capacity": 16
      },
      {
        "from": "s",
        "to": "v2",
        "capacity": 13
      },
      {
        "from": "v2",
        "to": "v1",
        "capacity": 4
      },
      {
        "from": "v1",
        "to": "v3",
        "capacity": 12
      },
      {
        "from": "v3",
        "to": "v2",
        "capacity": 9
      },
      {
        "from": "v2",
        "to": "v4",
        "capacity": 14
      },
      {
        "from": "v4",
        "to": "v3",
        "capacity": 7
      },
      {
        "from": "v3",
        "to": "t",
        "capacity": 20
      },
      {
        "from": "v4",
        "to": "t",
        "capacity": 4
      }
    ],
    "source": "s",
    "sink": "t",
    "claim": {
      "flows": [
        11,
        8,
        1,
        12,
        4,
        11,
        7,
        15,
        4
      ],
      "value": 19
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/network-flow-feasibility-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"nodes":["s","v1","v2","v3","v4","t"],"edges":[{"from":"s","to":"v1","capacity":16},{"from":"s","to":"v2","capacity":13},{"from":"v2","to":"v1","capacity":4},{"from":"v1","to":"v3","capacity":12},{"from":"v3","to":"v2","capacity":9},{"from":"v2","to":"v4","capacity":14},{"from":"v4","to":"v3","capacity":7},{"from":"v3","to":"t","capacity":20},{"from":"v4","to":"t","capacity":4}],"source":"s","sink":"t","claim":{"flows":[11,8,1,12,4,11,7,15,4],"value":19}}'

The machine-readable contract is at /v1/tools/network-flow-feasibility-check/versions/1.0.0.

CLI

node cli.mjs run network-flow-feasibility-check 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.