Simplify Your Workflow: Search MiniWebtool.
Add Extension
Related Tools
Absolute Value CalculatorAdjacency Matrix CalculatorAmicable Number CheckerCarry and Borrow VisualizerDijkstra's Shortest Path Calculator
Home Page > Math > Advanced Math Operations > Network Flow Calculator (Max Flow)

Network Flow Calculator (Max Flow)

Compute the maximum flow from source to sink in a capacitated directed network using the Ford-Fulkerson method (Edmonds-Karp). Animates every augmenting path, shows residual capacities, saturated edges, and the min-cut partition that proves optimality.

Network Flow Calculator (Max Flow)
Edge format: A -> B : 10 (arrow plus capacity), or A, B, 10. Matrix format: one row per line, C[i][j] is the capacity of edge i โ†’ j (use 0 for no edge). Diagonal must be 0.
Comma- or space-separated labels, one per matrix row. Defaults to S, A, B, โ€ฆ, T.

Embed Network Flow Calculator (Max Flow) Widget

About Network Flow Calculator (Max Flow)

The Network Flow Calculator computes the maximum flow from a chosen source s to a chosen sink t in any capacitated directed network. Under the hood it runs the Ford-Fulkerson method with breadth-first augmenting paths (the Edmonds-Karp algorithm), then records every path it found so you can replay the entire decision process one iteration at a time. The result page also surfaces the min-cut โ€” the bottleneck partition that proves your flow value is truly optimal.

What Is the Maximum Flow Problem?

A flow network is a directed graph G = (V, E) together with a capacity function c: E โ†’ โ„โ‰ฅ0. Two vertices are distinguished: the source s (where flow originates) and the sink t (where it is consumed). A flow f is any assignment f(u, v) โ‰ฅ 0 on edges that obeys:

Capacity: 0 โ‰ค f(u, v) โ‰ค c(u, v) for every edge (u, v) Conservation: ฮฃ f(w, v) = ฮฃ f(v, w) for every v โˆˆ V \ {s, t} Flow value: |f| = ฮฃ f(s, w) โˆ’ ฮฃ f(w, s) (net flow leaving s)

The maximum flow problem asks for the flow f that maximises |f|. Intuitively: if the edges were water pipes with the given capacities, how many litres per second can you ship from s to t?

How the Algorithm Works โ€” Ford-Fulkerson with BFS

The algorithm maintains a residual graph alongside the current flow. For every edge (u, v) with capacity c and current flow f, the residual graph contains:

At each iteration it performs a breadth-first search from s to t over the residual graph. If a path is found, the smallest edge capacity on the path โ€” the bottleneck โ€” is added to flow on every forward edge and subtracted on every reverse edge along the path. This is called an augmenting path. When BFS can no longer reach t, the current flow is optimal.

while there exists an augmenting path P from s to t in the residual graph: b โ† min c_residual(u, v) over edges (u, v) in P push b units of flow along P // updates residual + flow return total flow |f|

Using BFS (rather than arbitrary path-finding) turns Ford-Fulkerson into Edmonds-Karp, with a guaranteed running time of O(V ยท Eยฒ). It also guarantees termination on irrational capacities, which plain Ford-Fulkerson does not.

The Max-Flow Min-Cut Theorem

A cut is a partition of the vertices into two sets (S, T) with s โˆˆ S and t โˆˆ T. Its capacity is the sum of capacities of edges going from S to T:

cap(S, T) = ฮฃ c(u, v) for u โˆˆ S, v โˆˆ T

The max-flow min-cut theorem (Ford & Fulkerson, 1956) states:

maximum flow value = minimum cut capacity

This tool finds the min-cut automatically. After Edmonds-Karp terminates, it runs one more BFS from s on the residual graph; the vertices reached form S, the rest form T, and every edge crossing S โ†’ T in the original graph is saturated. Their capacities sum to exactly the max-flow value โ€” visible in the hero result as "Min-cut capacity โœ“ confirms optimality".

Features Built for Learning

Input Formats

1. Edge list with capacities

One edge per line. The arrow form is most readable but several alternatives work:

S -> A : 10 S -> B : 13 A -> B : 10 B -> A : 4 B -> T : 14

Also accepted: A, B, 10 ยท A B 10 ยท A -> B , 10. Multiple edges between the same pair are summed.

2. Capacity matrix

One row per line, values separated by spaces or commas. Entry C[i][j] is the capacity of the edge from vertex i to vertex j. Use 0 for "no edge". The matrix must be square and the diagonal must be 0 (no self-loops).

S A B C D T S [ 0 10 0 10 0 0 ] A [ 0 0 4 2 8 0 ] B [ 0 0 0 0 0 10 ] C [ 0 0 0 0 9 0 ] D [ 0 0 6 0 0 10 ] T [ 0 0 0 0 0 0 ]

Enter matching vertex labels in the Matrix labels field (comma- or space-separated). If omitted, labels default to S, A, B, โ€ฆ, T.

Applications of Max Flow

DomainHow max flow is used
Transportation & logisticsHow much cargo can a rail/road/pipeline network move per day from origin to destination?
Bipartite matchingAssigning jobs to workers, students to projects. Unit-capacity max flow gives the maximum matching.
Image segmentationBoykovโ€“Kolmogorov min-cut in computer vision separates foreground from background pixels.
Network reliabilityMin-cut identifies the weakest links whose failure disconnects the network.
Project schedulingClosure problems and selection problems reduce to min-cut.
Baseball eliminationDetermines whether a team is mathematically eliminated from a league title.

Worked Example

The "Textbook" quick-example encodes a 6-node network with source S and sink T. Running Edmonds-Karp yields four augmenting paths:

  1. S โ†’ A โ†’ B โ†’ T with bottleneck 4 (edge A-B is the limiter). Running total: 4.
  2. S โ†’ A โ†’ D โ†’ T with bottleneck 6. Running total: 10.
  3. S โ†’ C โ†’ D โ†’ T with bottleneck 4 (edge D-T is now the limiter, only 4 left). Running total: 14.
  4. S โ†’ C โ†’ D โ†’ B โ†’ T with bottleneck 5. Running total: 19.

The algorithm stops โ€” no more augmenting paths exist. The min-cut is (S = {S, C}, T = {A, B, D, T}) with crossing edges S โ†’ A (capacity 10) and C โ†’ D (capacity 9), summing to 19 โ€” exactly the max flow value.

How to Use This Calculator

  1. Choose input format using the tabs โ€” edge list (recommended) or capacity matrix.
  2. Enter your network. You can start from a quick example and modify it. For matrix input, also supply labels if you want names other than S, A, B, โ€ฆ, T.
  3. Specify source and sink (or leave blank to auto-detect S and T).
  4. Click Compute Max Flow. The result page shows the max flow value, min-cut partition, a layered graph visualisation, every augmenting path, an edge utilisation table, and three matrices (capacity, flow, residual).
  5. Play the animation beneath the graph to replay the algorithm's decisions. Click any augmenting-path step to jump directly to it.

Limits

Frequently Asked Questions

What is the maximum flow problem?

Given a directed network where each edge has a non-negative capacity, the maximum flow problem asks: how much flow can be pushed from a designated source vertex s to a designated sink vertex t, subject to the rules that flow on each edge cannot exceed its capacity and flow entering every non-source, non-sink vertex must equal the flow leaving it? The answer is called the max flow value.

What is the Ford-Fulkerson method?

Ford-Fulkerson is a general technique for computing max flow. It repeatedly finds an augmenting path from source to sink in the residual graph and pushes as much flow as possible along that path (the bottleneck capacity), then updates the residual graph. The procedure terminates when no augmenting path exists. When implemented with breadth-first search for path selection, it is called Edmonds-Karp and runs in O(V ยท Eยฒ) time.

What is the min-cut of a flow network?

A cut is a partition of the vertices into two sets S and T such that the source is in S and the sink is in T. The capacity of the cut is the sum of capacities of edges from S to T. A min-cut is a cut of minimum capacity. The famous max-flow min-cut theorem proves that the maximum flow value always equals the minimum cut capacity, so finding one gives you the other for free.

What is the residual graph?

The residual graph tracks how much more flow can still be pushed on each edge. For every original edge (u, v) with capacity c and current flow f, the residual graph contains a forward edge (u, v) with capacity c minus f (remaining capacity) and a reverse edge (v, u) with capacity f (cancellable flow). An augmenting path uses edges of the residual graph, allowing the algorithm to undo earlier decisions.

Why does the tool use BFS for augmenting paths?

Choosing augmenting paths with breadth-first search (Edmonds-Karp) guarantees polynomial-time termination regardless of the edge capacities. Plain Ford-Fulkerson with an arbitrary path-finding strategy can loop for an exponential number of iterations on pathological inputs, and on irrational capacities it may not terminate at all. BFS also produces shortest augmenting paths, which are easier to read and reason about.

What does a saturated edge mean?

An edge is saturated when its flow equals its capacity, so no additional flow can be pushed on it. Saturated edges are bottlenecks of the network, and every min-cut consists entirely of saturated edges from the S-side to the T-side of the cut. The tool highlights saturated edges in red so you can see the bottleneck structure at a glance.

Further Reading

Reference this content, page, or tool as:

"Network Flow Calculator (Max Flow)" at https://MiniWebtool.com/network-flow-calculator-max-flow/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Apr 22, 2026

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Advanced Math Operations:

Top & Updated:

Random PickerRandom Name PickerInstagram User ID LookupImage ResizerLine CounterFPS ConverterRelative Standard Deviation CalculatorSort NumbersRemove SpacesFacebook User ID LookupMAC Address GeneratorBatting Average CalculatorWord to Phone Number ConverterERA CalculatorMAC Address LookupSlope and Grade CalculatorFeet and Inches to Cm ConverterSum CalculatorRandom Quote Generator๐Ÿ“ท OCR / Image to TextMercury Retrograde CalendarPercent Off Calculatorโฌ› Aspect Ratio CalculatorSun, Moon & Rising Sign Calculator ๐ŸŒž๐ŸŒ™โœจInvisible Text GeneratorSHA256 Hash GeneratorMerge VideosRandom Credit Card GeneratorRandom Truth or Dare GeneratorBroken Link CheckerAudio SplitterMaster Number CalculatorMP3 LooperRandom IMEI GeneratorNumber of Digits CalculatorCompound Growth CalculatorVertical Jump CalculatorRandom Superpower Generator๐Ÿ–ฑ๏ธ Click CounterOPS CalculatorBitwise CalculatorRandom Poker Hand GeneratorLog Base 10 CalculatorRandom Birthday GeneratorCm to Feet and Inches ConverterWord Ladder GeneratorFile Size ConverterRandom Activity GeneratorRoman Numerals ConverterPhone Number ExtractorSquare Root (โˆš) CalculatorSaturn Return CalculatorRandom Fake Address GeneratorYouTube Channel StatisticsOctal CalculatorRandom Movie PickerSalary Conversion CalculatorCaffeine Overdose CalculatorBattery Life CalculatorImage SplitterNumber to Word ConverterCompare Two StringsSun Position CalculatorText FormatterRandom Meal GeneratorIP Subnet CalculatorRandom Writing Prompt GeneratorOn Base Percentage CalculatorWeight Loss CalculatorAI Text HumanizerSlugging Percentage CalculatorHalfway Date CalculatorAdd Text to Image๐Ÿ“… Date CalculatorDecimal to BCD ConverterName RandomizerVideo to Image ExtractorStair CalculatorSHA512 Hash GeneratorBcrypt Hash Generator / CheckerTime Duration CalculatorRandom Loadout GeneratorBinary to Gray Code ConverterQuotient and Remainder CalculatorRemove AccentLong Division CalculatorVideo CompressorProportion CalculatorRemove Lines Containing...Cone Flat Pattern (Template) GeneratorMartingale Strategy CalculatorFirst n Digits of PiList of Prime NumbersPercent Growth Rate CalculatorWAR CalculatorBCD to Decimal ConverterGray Code to Binary ConverterRatio to Percentage CalculatorDistance Between Two Points CalculatorRandom Emoji GeneratorCM to Inches ConverterDay of the Year Calculator - What Day of the Year Is It Today?Bingo Card GeneratorRandom Group GeneratorConnect the Dots GeneratorAPI TesterYouTube Tag ExtractorArc Length CalculatorEmail ExtractorAcreage CalculatorBreak Line by CharactersLeap Years ListFlip VideoMD5 Hash GeneratorLunar Calendar ConverterSmall Text Generator โฝแถœแต’แต–สธ โฟ แต–แตƒหขแต—แต‰โพNumber ExtractorRandom User-Agent GeneratorAstrological Element Balance CalculatorWhat is my Lucky Number?๐ŸŽฐ Gacha Pity CalculatorDMS to Decimal Degrees ConverterWhat is my Zodiac Sign?Word Scramble GeneratorRandom Chord GeneratorAI Language DetectorIP Address to Hex ConverterBolt Torque CalculatorModulo CalculatorWHIP CalculatorLove Compatibility CalculatorSocial Media Username CheckerOutlier CalculatorLottery Number GeneratorVideo SplitterHebrew Calendar ConverterRandom Tournament Bracket GeneratorSourdough CalculatorAdd Prefix and Suffix to TextMolarity CalculatorDecibel (dB) CalculatorDay of Year CalendarImage CompressorAdjust Video SpeedRandom Object GeneratorPercentile CalculatorBinary to BCD ConverterRandom Number PickerURL ExtractorBeer Chill Time CalculatorMAC Address AnalyzerTrigonometric Equation Solver1099 Tax CalculatorHelium Balloon Lift CalculatorPER Calculator๐Ÿ”Š Tone GeneratorDestiny Number CalculatorAI ParaphraserRandom Math Problem GeneratorPVIFA CalculatorReverse VideoRandom Name GeneratorLED Resistor CalculatorRandom Chess Opening GeneratorRandom Time GeneratorText RepeatColor InverterList RandomizerEffect Size CalculatorRemove Audio from VideoHTML CompressorSum of Positive Integers CalculatorHypotenuse CalculatorMiter Angle CalculatorPercent to PPM ConverterPercentage Increase Calculator๐Ÿ” Plagiarism CheckerPVIF CalculatorHeight Percentile CalculatorReverse TextSort Text By Length๐Ÿ’ง Dew Point CalculatorName Number CalculatorRatio CalculatorYouTube Earnings EstimatorBoiling Point CalculatorRemove Leading Trailing SpacesSquare Numbers ListRandomize NumbersAmortization CalculatorMegapixel to Print Size Calculatorโš”๏ธ DPS CalculatorDecking CalculatorFirst n Digits of eImpermanent Loss CalculatorDirection Field / Slope Field PlotterEstimation CalculatorAI Punctuation AdderSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterBCD to Hex ConverterMedian CalculatorStandard Error CalculatorAverage CalculatorActual Cash Value CalculatorScientific Notation to Decimal ConverterAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderLbs to Kg ConverterHex to Decimal ConverterConvolution CalculatorRandom String GeneratorMarkup CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorSocial Media Post Time OptimizerCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hรดpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorBernoulli Equation CalculatorHeat Transfer CalculatorThermal Expansion CalculatorSpecific Heat Capacity CalculatorGear Ratio Calculator (Mechanical)Pulley System CalculatorHydraulic Cylinder Force CalculatorBelt Length CalculatorCloset Capsule CalculatorStorage Unit Size CalculatorMoving Box Quantity CalculatorGift Card Tip CalculatorGas vs Electric Cost ComparisonPrint Cost CalculatorHair Dye Mixing CalculatorLaundry Detergent Dosage CalculatorDishwasher Load OptimizerTile Grout CalculatorPaint Color Mixing CalculatorFlashcard Spaced Repetition SchedulerLearning Curve CalculatorCornell Notes GeneratorVocabulary Quiz GeneratorLanguage Learning Hours to Fluency CalculatorCollege Cost CalculatorScholarship ROI CalculatorAI Recipe Generator (From Ingredients)AI Gift Idea GeneratorAI Meal Plan GeneratorAI Workout Plan GeneratorAI Reading List GeneratorAI Travel Itinerary GeneratorAI Excuse Generator (Polite)AI Apology Letter WriterAI Unit Converter (Natural Language)AI Resume / CV AnalyzerAI Text Tone AnalyzerAI Data Visualizer (Paste CSV)AI Regex GeneratorAI SQL Query GeneratorPaycheck Calculator (Take-Home Pay)VA Loan CalculatorARM Mortgage CalculatorBiweekly Mortgage Payment CalculatorPMI CalculatorMortgage Points CalculatorBalloon Loan CalculatorInterest-Only Mortgage CalculatorConstruction Loan CalculatorLand Loan CalculatorBoat Loan CalculatorRV Loan CalculatorMotorcycle Loan CalculatorCar Affordability CalculatorOut-the-Door Price CalculatorRent Affordability CalculatorProrated Rent CalculatorRent Increase CalculatorMileage Reimbursement CalculatorPer Diem CalculatorInvoice GeneratorSalary Raise CalculatorSeverance Pay CalculatorHSA Calculator529 College Savings CalculatorI Bond CalculatorT-Bill CalculatorCD Ladder CalculatorCredit Utilization CalculatorLoan Comparison CalculatorGross-Up CalculatorSWP CalculatorRD CalculatorPPF CalculatorEPF CalculatorNPS CalculatorGratuity CalculatorHRA Exemption CalculatorUK Stamp Duty CalculatorZakat CalculatorTithe CalculatorBetting Odds ConverterPayPal Fee CalculatorStripe Fee CalculatorEtsy Fee CalculatoreBay Fee CalculatorAmazon FBA CalculatorShopify Profit CalculatorWholesale Price CalculatorCraft Pricing CalculatorDepreciation CalculatorEOQ CalculatorReorder Point CalculatorSafety Stock CalculatorFIFO / LIFO CalculatorContribution Margin CalculatorWorking Capital CalculatorCost Per Lead CalculatorEmail Marketing ROI CalculatorTip Pooling CalculatorWeek Number CalculatorAnniversary CalculatorHalf Birthday CalculatorSobriety CalculatorRetirement CountdownDate to Roman Numerals ConverterSunrise & Sunset CalculatorMoon Phase CalculatorNap CalculatorWorld ClockJulian Date ConverterISO 8601 Date FormatterChinese Gender PredictorImplantation CalculatorIVF Due Date CalculatorhCG Doubling Time CalculatorChild Height PredictorChild BMI Percentile CalculatorBaby Eye Color PredictorBaby Name Generator