{"uid":"cap_jV2MNOaiDR4SEXhZDZDO7","slug":"graph-algorithms-graph-statistics-44252476","name":"Graph Algorithms – Graph Statistics","description":"Graph statistics: degree sequence, density, bipartite check, tree or forest test, and diameter if connected.","url":"https://graph-algorithms.x402tookit.com/graph-stats?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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). true reports in/out degrees and directed density; structure tests then use the undirected skeleton"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"isTree":{"type":["boolean","null"]},"radius":{"type":["null","number"]},"source":{"type":["null","string"]},"degrees":{"type":["null","object"],"properties":{"0":{"type":["null","number"]},"1":{"type":["null","number"]},"2":{"type":["null","number"]},"3":{"type":["null","number"]},"4":{"type":["null","number"]},"5":{"type":["null","number"]},"6":{"type":["null","number"]},"7":{"type":["null","number"]},"8":{"type":["null","number"]},"9":{"type":["null","number"]}}},"density":{"type":["null","number"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"diameter":{"type":["null","number"]},"directed":{"type":["boolean","null"]},"hasCycle":{"type":["boolean","null"]},"isForest":{"type":["boolean","null"]},"isSimple":{"type":["boolean","null"]},"edgeCount":{"type":["null","number"]},"isRegular":{"type":["boolean","null"]},"maxDegree":{"type":["null","number"]},"minDegree":{"type":["null","number"]},"nodeCount":{"type":["null","number"]},"selfLoops":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"bipartition":{},"isBipartite":{"type":["boolean","null"]},"isConnected":{"type":["boolean","null"]},"oddCycleEdge":{"type":["array","null"],"items":{"type":"string"}},"averageDegree":{"type":["null","number"]},"isolatedNodes":{"type":["array","null"]},"parallelEdges":{"type":["null","number"]},"degreeSequence":{"type":["array","null"],"items":{"type":"number"}},"connectedComponents":{"type":["null","number"]},"averageShortestPathLength":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_BjSnzbWAPfJ3gxMRynO_U","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes graph statistics including degree sequence, density, bipartite check, tree/forest test, and diameter for a given edge list.","exampleAgentPrompt":"Can you analyze this graph and tell me its degree sequence, density, whether it's bipartite, whether it's a tree or forest, and its diameter? The edges are: A,B; B,C; C,D; D,A; A,C — treat it as undirected.","exampleUseCases":[{"title":"Social network structure check","prompt":"I have a social network with connections: Alice,Bob; Bob,Carol; Carol,Dave; Dave,Eve; Eve,Alice; Alice,Carol — can you tell me the degree sequence, density, whether it's bipartite, and its diameter?"},{"title":"Dependency tree validation","prompt":"I want to verify that my software module dependency graph is actually a tree with no cycles. The edges are: core,auth; core,db; auth,session; db,cache — is this a valid tree or forest, and does it have any cycles?"},{"title":"Small routing network analysis","prompt":"I'm studying this network: router1,router2; router2,router3; router3,router4; router1,router4; router2,router4 — give me the graph density, degree distribution, and diameter so I can understand how well-connected it is."}],"resultDescription":"Returns a JSON object with degree sequence (distribution of node degrees), graph density, bipartite check result, tree/forest classification, cycle detection, diameter (if connected), radius, directed flag, summary text, and any degraded/warning reasons.","failureModes":["Edge list exceeds 200 nodes or 1000 edges — returns error","Node names contain invalid characters outside allowed set — returns error","Malformed edge format (not 'from,to' or 'from,to,weight') — returns parse error","Graph is disconnected so diameter is not computed — returns null for diameter","Empty edge list with no nodes provided — may return degenerate/null statistics"],"whenToPreferThis":"Use this endpoint when you need a broad structural overview of a small-to-medium graph (up to 200 nodes, 1000 edges) in a single call — covering degree distribution, density, bipartite/tree/forest classification, cycle detection, and diameter all at once. Prefer this over the sibling shortest-path or flow endpoints when you need structural characterization rather than a specific path or flow result.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-02T12:31:02.327Z","isFirstParty":false,"canonicalSlug":"graph-algorithms-graph-statistics-44252476"}