Graph connected components

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

Partition a directed simple graph into undirected connected components, ignoring edge direction.

Use when you need to: graph connected components · undirected connected components · connected components ignoring edge direction.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "nodes": [
    "build",
    "lint",
    "docs",
    "deploy",
    "orphan"
  ],
  "edges": [
    {
      "from": "build",
      "to": "lint"
    },
    {
      "from": "lint",
      "to": "deploy"
    },
    {
      "from": "docs",
      "to": "deploy"
    }
  ]
}

Response:

{
  "result": {
    "components": [
      [
        "build",
        "lint",
        "docs",
        "deploy"
      ],
      [
        "orphan"
      ]
    ]
  }
}

How to call it

MCP

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

{
  "id": "graph-connected-components",
  "version": "1.0.0",
  "input": {
    "nodes": [
      "build",
      "lint",
      "docs",
      "deploy",
      "orphan"
    ],
    "edges": [
      {
        "from": "build",
        "to": "lint"
      },
      {
        "from": "lint",
        "to": "deploy"
      },
      {
        "from": "docs",
        "to": "deploy"
      }
    ]
  }
}

HTTP (no key)

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

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

CLI

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

Get the client at /clients/cli/.