Graph strongly connected components

graph-strongly-connected-components · version 1.0.0 · Graphs & scheduling · free, no key needed

Partition a directed simple graph into strongly connected components, listed by declared node index.

Use when you need to: graph strongly connected components · directed strongly connected components · collapse cyclic dependency clumps.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "nodes": [
    "build",
    "test",
    "lint",
    "package",
    "publish"
  ],
  "edges": [
    {
      "from": "build",
      "to": "test"
    },
    {
      "from": "test",
      "to": "lint"
    },
    {
      "from": "lint",
      "to": "build"
    },
    {
      "from": "test",
      "to": "package"
    },
    {
      "from": "package",
      "to": "publish"
    }
  ]
}

Response:

{
  "result": {
    "components": [
      [
        "build",
        "test",
        "lint"
      ],
      [
        "package"
      ],
      [
        "publish"
      ]
    ]
  }
}

How to call it

MCP

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

{
  "id": "graph-strongly-connected-components",
  "version": "1.0.0",
  "input": {
    "nodes": [
      "build",
      "test",
      "lint",
      "package",
      "publish"
    ],
    "edges": [
      {
        "from": "build",
        "to": "test"
      },
      {
        "from": "test",
        "to": "lint"
      },
      {
        "from": "lint",
        "to": "build"
      },
      {
        "from": "test",
        "to": "package"
      },
      {
        "from": "package",
        "to": "publish"
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/graph-strongly-connected-components/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"nodes":["build","test","lint","package","publish"],"edges":[{"from":"build","to":"test"},{"from":"test","to":"lint"},{"from":"lint","to":"build"},{"from":"test","to":"package"},{"from":"package","to":"publish"}]}'

The machine-readable contract is at /v1/tools/graph-strongly-connected-components/versions/1.0.0.

CLI

node cli.mjs run graph-strongly-connected-components 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.