{"uid":"cap_5FPIdql-7gkmHCO97lqCV","slug":"graph-algorithms-edmonds-karp-maximum-flow-11663b1d","name":"Graph Algorithms – Edmonds-Karp Maximum Flow","description":"Edmonds-Karp maximum flow from a source to a sink on a capacity edge list, with flow per edge and min cut edges.","url":"https://graph-algorithms.x402tookit.com/max-flow?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","source","sink"],"properties":{"sink":{"type":"string","description":"Sink node name; must differ from the source"},"edges":{"type":"string","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"},"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"},"source":{"type":"string","description":"Source node name"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"source":{"type":["null","string"]},"maxFlow":{"type":["null","number"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"sinkNode":{"type":["null","string"]},"edgeFlows":{"type":["array","null"],"items":{"type":"object","properties":{"to":{"type":["null","string"]},"flow":{"type":["null","number"]},"from":{"type":["null","string"]},"capacity":{"type":["null","number"]}}}},"startNode":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"sourceSide":{"type":["array","null"],"items":{"type":"string"}},"minCutEdges":{"type":["array","null"],"items":{"type":"object","properties":{"to":{"type":["null","string"]},"from":{"type":["null","string"]},"capacity":{"type":["null","number"]}}}},"minCutCapacity":{"type":["null","number"]},"augmentingPaths":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.03","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.03/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_3vgyMrtuifWi1h9xFEGZT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.03","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the Edmonds-Karp maximum flow from a source to a sink on a directed capacity edge list, returning flow per edge and minimum cut edges.","exampleAgentPrompt":"Find the maximum flow from node 'S' to node 'T' in this network: edges are S,A,10; S,B,5; A,B,3; A,T,7; B,T,8 — show me the flow on each edge and which edges form the minimum cut.","exampleUseCases":[{"title":"Network bandwidth bottleneck analysis","prompt":"I have a data-center network with these links and their capacities: router1,router2,100; router1,router3,60; router2,datacenter,80; router3,datacenter,70; router2,router3,20. What's the maximum throughput from router1 to the datacenter, and which links are the bottleneck?"},{"title":"Supply chain maximum throughput","prompt":"I need to find how many units per day can flow from our warehouse node 'WH' to the distribution center 'DC' given these routes and their daily limits: WH,Hub1,500; WH,Hub2,300; Hub1,DC,400; Hub2,DC,350; Hub1,Hub2,150. Also tell me which routes are fully saturated."},{"title":"Minimum cut for network segmentation","prompt":"Given this internal network topology — ingress,fw1,1000; ingress,fw2,800; fw1,core,900; fw2,core,750; core,egress,1200 — what is the minimum set of links I'd need to sever to completely isolate the egress node from the ingress node, and what's the combined capacity of those cut links?"}],"resultDescription":"Returns the maximum flow value between source and sink, an array of edge objects each showing from/to/capacity/flow, the minimum cut capacity, the list of min-cut edges (from/to/capacity), the set of nodes on the source side of the cut, and a human-readable summary. Also includes metadata like asOf timestamp and any degraded/disclaimer flags.","failureModes":["Missing required parameters (edges, source, or sink) returns a validation error","Source and sink node names are identical — the API requires them to differ","Edge list exceeds limits (>200 nodes, >1000 edges, or >60000 characters) causes rejection","Malformed edge format (missing capacity, non-numeric capacity, wrong delimiter) causes parse error","Capacity values outside the 0–1e9 range may be rejected","Network with no path from source to sink returns max flow of 0"],"whenToPreferThis":"Choose this endpoint when you need to solve a directed maximum flow problem using the Edmonds-Karp (BFS-augmenting-path) algorithm and require both the max flow value and the minimum cut decomposition. It supports graphs up to 200 nodes and 1000 edges, making it suitable for medium-scale network flow problems in logistics, network design, or capacity planning. Prefer this over Dijkstra or Bellman-Ford sibling endpoints when the problem is about throughput/capacity rather than shortest paths.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-02T12:30:51.183Z","isFirstParty":false,"canonicalSlug":"graph-algorithms-edmonds-karp-maximum-flow-11663b1d"}