# Graph Algorithms – Connected Components

> Graph Algorithms – Connected Components is a paid API for AI agents from graph-algorithms.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-02).

Finds connected components of an undirected edge list, or strongly and weakly connected components of a directed graph using Tarjan's algorithm.

## Facts

- Endpoint: GET https://graph-algorithms.x402tookit.com/connected-components?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/graph-algorithms-connected-components-b5aa7b07
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tFqz0uteH3d1TxwNfeKPg

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability graph-algorithms-connected-components-b5aa7b07
```

Example prompt: Take this edge list — A,B; B,C; D,E; E,F; G — and tell me how many connected components there are and which nodes belong to each group; also include G as an isolated node.

## When to prefer this

Use this endpoint when you need to partition a graph into connected groups, check global connectivity, or (with directed=true) identify strongly connected components and cycle membership in a directed graph. It supports up to 200 nodes and 1000 edges and accepts flexible edge list formats. Prefer this over the other graph algorithm endpoints when the question is about reachability and clustering rather than shortest paths, flow, or spanning trees.

## Known failure modes

- Edge list exceeds 200 nodes or 1000 edges — request rejected
- Edge list string exceeds 60000 characters — request rejected
- Malformed edge format (not 'from,to' or 'from,to,weight') — parse error returned
- Node names contain invalid characters (outside letters, digits, _ . : + - ) — parse error
- Empty edge list with no nodes parameter — may return empty result or error
- Network timeout on very large valid inputs

## How this service works

Connected components of an edge list; with directed=true also strongly connected components via Tarjan.

## Output

Returns a JSON object with node count, edge count, whether the graph is connected (isConnected), the number of components, the largest component size, a list of all components with their member nodes, and (if directed=true) strongly connected component count, weakly connected component count, largest SCC size, and number of nodes on a cycle.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "edges"
     ],
     "properties": {
      "edges": {
       "type": "string",
       "description": "Edges separated by ; or newline, each 'from,to' or 'from,to,weight' (default weight 1), or a JSON array of [from,to,weight]; up to 200 nodes, 1000 edges, 60000 characters; node names 1-32 characters of letters, digits, _ . : + - (weights ignored)"
      },
      "nodes": {
       "type": "string",
       "description": "Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap"
      },
      "directed": {
       "type": "boolean",
       "description": "false (default): undirected components. true: edges are one-way; returns strongly connected components plus weakly connected ones"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "directed": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "edgeCount": {
       "type": [
        "null",
        "number"
       ]
      },
      "nodeCount": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/graph-algorithms-connected-components-b5aa7b07/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from graph-algorithms.x402tookit.com](https://www.zero.xyz/host/graph-algorithms.x402tookit.com/llms.txt)
