Maximum flow certificate check

maximum-flow-certificate-check · version 1.0.0 · Numbers & math · free, no key needed

Check a claimed max flow with a min-cut certificate or residual search; reports the first failure or augmenting path.

Use when you need to: verify a maximum flow answer · check max flow with a min cut certificate · is this flow maximum or is there an augmenting path.

Decide before calling

Read the versioned contract and the supported scope below. Reuse maximum-flow-certificate-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 maximum-flow-certificate-check@1.0.0 for verify a maximum flow answer. 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,
      12,
      1,
      12,
      0,
      11,
      7,
      19,
      4
    ],
    "value": 23,
    "source_side": [
      "s",
      "v1",
      "v2",
      "v4"
    ]
  }
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "first_discrepancy": null,
    "flow_value": "23",
    "method": "cut_certificate",
    "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": "maximum-flow-certificate-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,
        12,
        1,
        12,
        0,
        11,
        7,
        19,
        4
      ],
      "value": 23,
      "source_side": [
        "s",
        "v1",
        "v2",
        "v4"
      ]
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/maximum-flow-certificate-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,12,1,12,0,11,7,19,4],"value":23,"source_side":["s","v1","v2","v4"]}}'

The machine-readable contract is at /v1/tools/maximum-flow-certificate-check/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.