{"openapi":"3.1.0","info":{"title":"Graph Algorithms","version":"1.0.0","description":"Shortest paths, spanning trees, topological order, components, max flow, graph statistics and all-pairs distances from a caller-supplied edge list. One call, one computed answer, no accounts or API keys. Machine-payable over x402.","x-guidance":"Graph Algorithms: Shortest paths, spanning trees, topological order, components, max flow, graph statistics and all-pairs distances from a caller-supplied edge list. Use /shortest-path for Dijkstra, /bellman-ford for negative weights, /minimum-spanning-tree for Kruskal, /topological-sort for ordering and cycles, /connected-components for components and SCCs, /max-flow for flow and min cut, /graph-stats for degrees and diameter, and /all-pairs-shortest for Floyd-Warshall. Each paid GET returns a computed verdict with the reasons, the source and what was NOT checked. A verdict of UNVERIFIED means a lookup failed: treat it as unknown. No account or key: pay per call in USDC over x402."},"servers":[{"url":"https://graph-algorithms.x402tookit.com"}],"paths":{"/all-pairs-shortest":{"get":{"operationId":"all_pairs_shortest","summary":"Floyd-Warshall all-pairs shortest distances for up to 100 nodes; negative weights ok; detects negative cycles.","description":"Floyd-Warshall all-pairs shortest distances for up to 100 nodes; negative weights ok; detects negative cycles.","tags":["graph","floyd-warshall","all-pairs","shortest-path"],"parameters":[{"name":"edges","in":"query","required":true,"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 100 nodes for this endpoint, 1000 edges, 60000 characters; node names 1-32 characters of letters, digits, _ . : + -","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap","schema":{"type":"string"}},{"name":"directed","in":"query","required":false,"description":"true (default); false makes each edge two-way (a negative edge then is a negative cycle)","schema":{"type":"boolean"}},{"name":"from","in":"query","required":false,"description":"Optional node: with 'to', also returns that shortest path","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"Optional node: with 'from', also returns that shortest path","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"]},"nodeCount":{"type":["null","number"]},"edgeCount":{"type":["null","number"]},"directed":{"type":["boolean","null"]},"order":{"type":["array","null"],"items":{"type":"string"}},"distances":{"type":["array","null"],"items":{"type":"array","items":{"type":"number"}}},"reachablePairs":{"type":["null","number"]},"unreachablePairs":{"type":["null","number"]},"path":{"type":["array","null"],"items":{"type":"string"}},"pathDistance":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"PATH_FOUND","summary":"Shortest 3 to 5 is 3 via 3 > 2 > 4 > 1 > 5.","reasons":[],"nodeCount":5,"edgeCount":9,"directed":true,"order":["1","2","…3 more"],"distances":[[0,1],[3,0]],"reachablePairs":20,"unreachablePairs":0,"path":["3","2","…3 more"],"pathDistance":3,"degraded":false,"notChecked":["graphs over 100 nodes or 1000 edges (refused)","ties: one shortest path is returned when several exist"],"source":"Floyd-Warshall algorithm, computed locally (CLRS ch. 25.2)","asOf":"2026-10-21T01:36:13.445Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0300"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/all-pairs-shortest"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/all-pairs-shortest"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/all-pairs-shortest"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/all-pairs-shortest"}}]}}},"/bellman-ford":{"get":{"operationId":"bellman_ford","summary":"Bellman-Ford shortest paths with negative weights; reports a negative cycle reachable from the source.","description":"Bellman-Ford shortest paths with negative weights; reports a negative cycle reachable from the source.","tags":["graph","bellman-ford","negative-weights","algorithm"],"parameters":[{"name":"edges","in":"query","required":true,"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, _ . : + -","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap","schema":{"type":"string"}},{"name":"source","in":"query","required":true,"description":"Start node name; must appear in edges","schema":{"type":"string"}},{"name":"target","in":"query","required":false,"description":"Optional end node; if given the path to it is returned","schema":{"type":"string"}},{"name":"directed","in":"query","required":false,"description":"true (default); with false any negative edge is itself a negative cycle","schema":{"type":"boolean"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"startNode":{"type":["null","string"]},"directed":{"type":["boolean","null"]},"nodeCount":{"type":["null","number"]},"edgeCount":{"type":["null","number"]},"negativeCycle":{},"distances":{"type":["null","object"],"properties":{"s":{"type":["null","number"]},"t":{"type":["null","number"]},"y":{"type":["null","number"]},"x":{"type":["null","number"]},"z":{"type":["null","number"]}}},"unreachable":{"type":["array","null"]},"target":{"type":["null","string"]},"distance":{"type":["null","number"]},"path":{"type":["array","null"],"items":{"type":"string"}},"hops":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"PATH_FOUND","summary":"Shortest s to z is -2 via s > y > x > t > z.","reasons":["No negative cycle is reachable from the source, so distances are well defined."],"startNode":"s","directed":true,"nodeCount":5,"edgeCount":10,"negativeCycle":null,"distances":{"s":0,"t":2,"y":7,"x":4,"z":-2},"unreachable":[],"target":"z","distance":-2,"path":["s","y","…3 more"],"hops":4,"degraded":false,"notChecked":["graphs over 200 nodes or 1000 edges (refused)","negative cycles NOT reachable from the source (they do not affect its distances and are not reported)"],"source":"Bellman-Ford algorithm, computed locally (CLRS ch. 24.1)","asOf":"2026-10-21T01:36:13.708Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/bellman-ford"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/bellman-ford"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/bellman-ford"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/bellman-ford"}}]}}},"/connected-components":{"get":{"operationId":"connected_components","summary":"Connected components of an edge list; with directed=true also strongly connected components via Tarjan.","description":"Connected components of an edge list; with directed=true also strongly connected components via Tarjan.","tags":["graph","connected-components","tarjan","scc"],"parameters":[{"name":"edges","in":"query","required":true,"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)","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap","schema":{"type":"string"}},{"name":"directed","in":"query","required":false,"description":"false (default): undirected components. true: edges are one-way; returns strongly connected components plus weakly connected ones","schema":{"type":"boolean"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"nodeCount":{"type":["null","number"]},"edgeCount":{"type":["null","number"]},"directed":{"type":["boolean","null"]},"largestComponent":{"type":["null","number"]},"isConnected":{"type":["boolean","null"]},"weaklyConnectedComponents":{"type":["array","null"],"items":{"type":"array","items":{"type":"string"}}},"weaklyConnectedCount":{"type":["null","number"]},"stronglyConnectedComponents":{"type":["array","null"],"items":{"type":"array","items":{"type":"string"}}},"stronglyConnectedCount":{"type":["null","number"]},"largestStronglyConnected":{"type":["null","number"]},"isStronglyConnected":{"type":["boolean","null"]},"nodesOnACycle":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"NOT_STRONGLY_CONNECTED","summary":"2 strongly connected components (1 weakly connected); largest has 3 nodes.","reasons":["Two nodes share a strongly connected component when each can reach the other along edge directions. Components of size 1 without a self-loop are not on any cycle."],"nodeCount":5,"edgeCount":6,"directed":true,"largestComponent":5,"isConnected":true,"weaklyConnectedComponents":[["a","b","…3 more"]],"weaklyConnectedCount":1,"stronglyConnectedComponents":[["a","b","…1 more"],["d","e"]],"stronglyConnectedCount":2,"largestStronglyConnected":3,"isStronglyConnected":false,"nodesOnACycle":5,"degraded":false,"notChecked":["graphs over 200 nodes or 1000 edges (refused)","the order of components beyond size (largest first) and node order within a component (first appearance in the input)"],"source":"union-find and Tarjan's strongly connected components algorithm, computed locally (CLRS ch. 22.5, Sedgewick 4.2)","asOf":"2026-10-21T01:36:13.970Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/connected-components"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/connected-components"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/connected-components"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/connected-components"}}]}}},"/graph-stats":{"get":{"operationId":"graph_stats","summary":"Graph statistics: degree sequence, density, bipartite check, tree or forest test, and diameter if connected.","description":"Graph statistics: degree sequence, density, bipartite check, tree or forest test, and diameter if connected.","tags":["graph","degree","bipartite","diameter"],"parameters":[{"name":"edges","in":"query","required":true,"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)","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap","schema":{"type":"string"}},{"name":"directed","in":"query","required":false,"description":"false (default). true reports in/out degrees and directed density; structure tests then use the undirected skeleton","schema":{"type":"boolean"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"nodeCount":{"type":["null","number"]},"edgeCount":{"type":["null","number"]},"directed":{"type":["boolean","null"]},"selfLoops":{"type":["null","number"]},"parallelEdges":{"type":["null","number"]},"isSimple":{"type":["boolean","null"]},"degreeSequence":{"type":["array","null"],"items":{"type":"number"}},"minDegree":{"type":["null","number"]},"maxDegree":{"type":["null","number"]},"averageDegree":{"type":["null","number"]},"isRegular":{"type":["boolean","null"]},"isolatedNodes":{"type":["array","null"]},"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"]},"connectedComponents":{"type":["null","number"]},"isConnected":{"type":["boolean","null"]},"isBipartite":{"type":["boolean","null"]},"bipartition":{},"oddCycleEdge":{"type":["array","null"],"items":{"type":"string"}},"isTree":{"type":["boolean","null"]},"isForest":{"type":["boolean","null"]},"hasCycle":{"type":["boolean","null"]},"diameter":{"type":["null","number"]},"radius":{"type":["null","number"]},"averageShortestPathLength":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"GRAPH","summary":"10 nodes, 15 edges, density 0.333333333: connected with cycles, not bipartite, diameter 3.","reasons":["Density = distinct edges / possible edges (ignores self-loops and repeats). A tree is a connected simple graph with n - 1 edges; a forest is a simple graph with n - components edges. Bipartite means 2…"],"nodeCount":10,"edgeCount":15,"directed":false,"selfLoops":0,"parallelEdges":0,"isSimple":true,"degreeSequence":[3,3],"minDegree":3,"maxDegree":3,"averageDegree":3,"isRegular":true,"isolatedNodes":[],"degrees":{"0":3,"1":3,"2":3,"3":3,"4":3,"5":3,"6":3,"7":3,"8":3,"9":3},"density":0.333333333,"connectedComponents":1,"isConnected":true,"isBipartite":false,"bipartition":null,"oddCycleEdge":["2","3"],"isTree":false,"isForest":false,"hasCycle":true,"diameter":3,"radius":3,"averageShortestPathLength":1.888888889,"degraded":false,"notChecked":["graphs over 200 nodes or 1000 edges (refused)","weighted diameter (this counts hops; use /all-pairs-shortest for weighted distances)","…1 more"],"source":"breadth-first search and degree counting, computed locally","asOf":"2026-10-21T01:36:14.234Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/graph-stats"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/graph-stats"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/graph-stats"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/graph-stats"}}]}}},"/max-flow":{"get":{"operationId":"max_flow","summary":"Edmonds-Karp maximum flow from a source to a sink on a capacity edge list, with flow per edge and min cut edges.","description":"Edmonds-Karp maximum flow from a source to a sink on a capacity edge list, with flow per edge and min cut edges.","tags":["graph","max-flow","min-cut","edmonds-karp"],"parameters":[{"name":"edges","in":"query","required":true,"description":"Directed edges 'from,to,capacity' (capacity required, 0 to 1e9) separated by ; or newline, or JSON [from,to,capacity]; up to 200 nodes, 1000 edges, 60000 characters","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap","schema":{"type":"string"}},{"name":"source","in":"query","required":true,"description":"Source node name","schema":{"type":"string"}},{"name":"sink","in":"query","required":true,"description":"Sink node name; must differ from the source","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"startNode":{"type":["null","string"]},"sinkNode":{"type":["null","string"]},"maxFlow":{"type":["null","number"]},"augmentingPaths":{"type":["null","number"]},"minCutCapacity":{"type":["null","number"]},"minCutEdges":{"type":["array","null"],"items":{"type":"object","properties":{"from":{"type":["null","string"]},"to":{"type":["null","string"]},"capacity":{"type":["null","number"]}}}},"sourceSide":{"type":["array","null"],"items":{"type":"string"}},"edgeFlows":{"type":["array","null"],"items":{"type":"object","properties":{"from":{"type":["null","string"]},"to":{"type":["null","string"]},"capacity":{"type":["null","number"]},"flow":{"type":["null","number"]}}}},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"FLOW_FOUND","summary":"Maximum flow s to t is 23; the minimum cut has 3 edges of total capacity 23.","reasons":["Max-flow min-cut theorem: the maximum flow equals the capacity of the minimum cut, so flow value and cut capacity above agree."],"startNode":"s","sinkNode":"t","maxFlow":23,"augmentingPaths":3,"minCutCapacity":23,"minCutEdges":[{"from":"v1","to":"v3","capacity":12},{"from":"v4","to":"v3","capacity":7}],"sourceSide":["s","v1","…2 more"],"edgeFlows":[{"from":"s","to":"v1","capacity":16,"flow":12},{"from":"s","to":"v2","capacity":13,"flow":11}],"degraded":false,"notChecked":["graphs over 200 nodes or 1000 edges (refused)","uniqueness: many max flows and sometimes several min cuts exist; the source-side-closest min cut is reported","…1 more"],"source":"Edmonds-Karp algorithm (shortest augmenting paths), computed locally (CLRS ch. 26.2)","asOf":"2026-10-21T01:36:14.497Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0300"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/max-flow"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/max-flow"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/max-flow"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/max-flow"}}]}}},"/minimum-spanning-tree":{"get":{"operationId":"minimum_spanning_tree","summary":"Kruskal minimum spanning tree of an undirected weighted edge list; returns a spanning forest if disconnected.","description":"Kruskal minimum spanning tree of an undirected weighted edge list; returns a spanning forest if disconnected.","tags":["graph","kruskal","mst","algorithm"],"parameters":[{"name":"edges","in":"query","required":true,"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, _ . : + -. Edges are undirected","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"nodeCount":{"type":["null","number"]},"edgeCount":{"type":["null","number"]},"components":{"type":["null","number"]},"totalWeight":{"type":["null","number"]},"treeEdgeCount":{"type":["null","number"]},"treeEdges":{"type":["array","null"],"items":{"type":"object","properties":{"from":{"type":["null","string"]},"to":{"type":["null","string"]},"weight":{"type":["null","number"]}}}},"skippedSelfLoops":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"SPANNING_TREE","summary":"Minimum spanning tree of 9 nodes: 8 edges, total weight 37.","reasons":["Kruskal adds the cheapest edge that does not close a cycle; a tree on n nodes has n - 1 edges, a forest n - components."],"nodeCount":9,"edgeCount":14,"components":1,"totalWeight":37,"treeEdgeCount":8,"treeEdges":[{"from":"g","to":"h","weight":1},{"from":"c","to":"i","weight":2}],"skippedSelfLoops":0,"degraded":false,"notChecked":["graphs over 200 nodes or 1000 edges (refused)","ties: equal-weight edges are taken in input order, so another equally cheap tree may exist","…1 more"],"source":"Kruskal's algorithm with union-find, computed locally (CLRS ch. 23.2)","asOf":"2026-10-21T01:36:14.761Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/minimum-spanning-tree"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/minimum-spanning-tree"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/minimum-spanning-tree"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/minimum-spanning-tree"}}]}}},"/shortest-path":{"get":{"operationId":"shortest_path","summary":"Dijkstra shortest path and distances from a source on a weighted edge list; negative weights point to /bellman-ford.","description":"Dijkstra shortest path and distances from a source on a weighted edge list; negative weights point to /bellman-ford.","tags":["graph","dijkstra","shortest-path","algorithm"],"parameters":[{"name":"edges","in":"query","required":true,"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, _ . : + -","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap","schema":{"type":"string"}},{"name":"source","in":"query","required":true,"description":"Start node name; must appear in edges","schema":{"type":"string"}},{"name":"target","in":"query","required":false,"description":"Optional end node; if given the path to it is returned","schema":{"type":"string"}},{"name":"directed","in":"query","required":false,"description":"true (default) edges one way; false treats each edge as two-way","schema":{"type":"boolean"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"startNode":{"type":["null","string"]},"directed":{"type":["boolean","null"]},"nodeCount":{"type":["null","number"]},"edgeCount":{"type":["null","number"]},"reachableCount":{"type":["null","number"]},"distances":{"type":["null","object"],"properties":{"s":{"type":["null","number"]},"t":{"type":["null","number"]},"y":{"type":["null","number"]},"x":{"type":["null","number"]},"z":{"type":["null","number"]}}},"unreachable":{"type":["array","null"]},"target":{"type":["null","string"]},"distance":{"type":["null","number"]},"path":{"type":["array","null"],"items":{"type":"string"}},"hops":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"PATH_FOUND","summary":"Shortest s to x is 9 via s > y > t > x.","reasons":["Dijkstra settles nodes in order of distance, so each distance is final when settled (valid because no weight is negative)."],"startNode":"s","directed":true,"nodeCount":5,"edgeCount":10,"reachableCount":5,"distances":{"s":0,"t":8,"y":5,"x":9,"z":7},"unreachable":[],"target":"x","distance":9,"path":["s","y","…2 more"],"hops":3,"degraded":false,"notChecked":["graphs over 200 nodes or 1000 edges (refused)","ties: when several shortest paths exist, one is returned","…1 more"],"source":"Dijkstra's algorithm with a binary heap, computed locally (CLRS ch. 24.3)","asOf":"2026-10-21T01:36:15.022Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/shortest-path"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/shortest-path"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/shortest-path"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/shortest-path"}}]}}},"/topological-sort":{"get":{"operationId":"topological_sort","summary":"Topological order of a directed graph (Kahn) with parallel layers; on a cycle returns the cycle's nodes.","description":"Topological order of a directed graph (Kahn) with parallel layers; on a cycle returns the cycle's nodes.","tags":["graph","topological-sort","dag","dependencies"],"parameters":[{"name":"edges","in":"query","required":true,"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, _ . : + -. Each edge 'a,b' means a must come before b (weights ignored)","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"nodeCount":{"type":["null","number"]},"edgeCount":{"type":["null","number"]},"cycle":{},"order":{"type":["array","null"],"items":{"type":"string"}},"layers":{"type":["array","null"],"items":{"type":"array","items":{"type":"string"}}},"criticalPathLength":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"ORDERED","summary":"Valid order of 9 nodes in 4 layers.","reasons":["Nodes in one layer have no dependencies on each other and can run in parallel."],"nodeCount":9,"edgeCount":9,"cycle":null,"order":["undershorts","socks","…7 more"],"layers":[["undershorts","socks","…2 more"],["pants","tie"]],"criticalPathLength":4,"degraded":false,"notChecked":["graphs over 200 nodes or 1000 edges (refused)","uniqueness: most DAGs have many valid orders and one is returned (nodes ready together are listed in first-seen order)"],"source":"Kahn's algorithm, computed locally (CLRS ch. 22.4)","asOf":"2026-10-21T01:36:15.285Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/topological-sort"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/topological-sort"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/topological-sort"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://graph-algorithms.x402tookit.com/topological-sort"}}]}}}}}