{"id":"graph-find-cycle","version":"1.0.0","description":"Find one directed cycle by 3-color DFS, or report that the graph is acyclic.","supported_operations":["graph find cycle","find a directed cycle","report one directed cycle"],"unsupported_operations":["listing every cycle","enumerating all simple cycles","undirected cycles","cycle basis","topological sort"],"semantics":["Input is a directed simple graph: unique node ids and unique {from,to} edges whose endpoints are in nodes.","DFS iterates candidate roots in declared node index order 0..n-1 and skips already finished (black) nodes.","From a node, outgoing neighbors are walked in declared edge order.","Nodes are 3-colored white, gray, and black. The first back-edge to a gray node defines the reported cycle.","The cycle lists node ids starting at that back-edge target, continuing along the gray stack, then repeating the start.","The cycle is not rotated to the minimum declared index. Discovery order is the contract.","A self-loop is a cycle of the form [id, id]. Every reported cycle has length at least 2.","An empty graph is not cyclic. A DAG is not cyclic: cyclic is false and cycle is []."],"limits":{"max_nodes":2000,"max_edges":10000,"max_node_id_bytes":256},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["nodes","edges"],"properties":{"nodes":{"type":"array","maxItems":2000,"items":{"type":"string","minLength":1,"maxLength":256}},"edges":{"type":"array","maxItems":10000,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","minLength":1,"maxLength":256},"to":{"type":"string","minLength":1,"maxLength":256}}}}}},"output_schema":{"type":"object","additionalProperties":false,"required":["cyclic","cycle"],"properties":{"cyclic":{"type":"boolean"},"cycle":{"type":"array","items":{"type":"string"}}}},"examples":[{"input":{"nodes":["a","b","c"],"edges":[{"from":"a","to":"b"},{"from":"b","to":"c"},{"from":"c","to":"a"}]},"output":{"cyclic":true,"cycle":["a","b","c","a"]}}],"execute_url":"/v1/tools/graph-find-cycle/versions/1.0.0/execute"}