How this calculation works
Choose one shortest path per demand to minimize the busiest undirected edge load.
min over Pᵢ∈Shortest(sᵢ,tᵢ) max_e Σᵢ 1[e∈Pᵢ].A worked example
Three opposite-corner demands on the default square require six edge traversals across four edges. Congestion is at least two, and a shortest-path selection attains two.
Good to know
Connected unweighted simple graph on 1–8 vertices, 1–6 demand pairs. Unit unsplittable demands; repeated demands count separately. Exact enumeration capped at 500,000 path/search states; cap errors certify no optimum.
Balance fixed shortest route demands
Each demand names a source and destination that must receive one complete route. Every chosen route must have minimum hop length for its pair. An undirected edge accumulates one unit of load for every demand using it, regardless of which direction that demand traverses the edge.
The objective minimizes the largest edge load across the network. It does not minimize total route length because the shortest-path restriction already fixes each demand’s length. The remaining choices concern equal shortest alternatives and how those alternatives overlap. A seemingly arbitrary route choice can create an avoidable bottleneck.
Compare this with the Maximum flow minimum cut calculator for a directed graph. Choose one shortest path for each supplied demand pair to minimize maximum edge load,rather than split flow or disconnect demands.
Enter topology and demand identities
The edge input describes a connected simple undirected graph with zero-based vertex labels. Give each demand on a separate row with two distinct valid endpoints. Repeating a demand row is allowed and means another independent unit request, rather than a duplicate topology edge to be merged or rejected.
At most eight vertices and six demand rows are accepted. Edge weights, capacities and fractional requests are outside this model. A pair with identical endpoints is rejected so every demand has a nonempty route. The graph must be connected; unreachable demands are not silently omitted from the objective.
Understand the square bottleneck example
The default square has four edges. Each of its three opposite-corner demands needs two edge traversals, so any route selection contributes six units of total edge load. If every edge had load at most one, it could carry only four units altogether. Therefore congestion must be at least two.
Choose two opposite routes for the repeated zero-to-two demands, then either shortest route for the one-to-three demand. No edge is used more than twice, so the lower bound is attained. The optimum is two, even though the exact pair of edges at load two can vary between equally good witnesses.
Enumerate shortest routes without detours
All-pairs hop distances determine the allowed route steps. From a current vertex, a step is eligible only when it decreases the distance to the demand destination by one. Repeating this rule produces every shortest route and cannot create a cycle because the remaining distance strictly decreases each time.
The search then considers one route from each demand’s list. Partial edge loads can only increase when more routes are added, so a partial selection already as congested as the best completed selection cannot improve it. This pruning preserves the optimum while avoiding route combinations that are already provably uncompetitive.
Check routes against edge loads
The path list follows demand-row order, including repeated pairs. Every neighboring vertex pair along a returned path must be an entered edge, and the number of steps must equal that demand’s shortest distance. Count an edge use in either direction toward the same undirected edge identity.
The edge-load table should match those counted traversals. Its largest load is the reported congestion. Also check that the sum of edge loads equals the sum of route lengths. This conservation check catches omitted or double-counted route steps without requiring a second optimization algorithm or any drawing of the graph.
Compare routing with flow models
A maximum-flow model can split a request among several paths and normally optimizes delivered quantity against capacities. This calculator fixes all requests, forbids splitting and optimizes their worst shared edge usage. Replacing a demand by two half-demands would change the problem and is not an accepted input shortcut.
Routes are shortest in the original topology, not in a topology that changes as other routes consume capacity. No request is rerouted onto a longer detour to reduce congestion. If longer paths or directional capacities are required, the resulting multicommodity routing model needs a different feasible-route definition and optimization method.
Read resource limits honestly
Both route enumeration and route selection share an explicit budget of five hundred thousand states. A budget failure produces an error even if a good route selection was found earlier. That earlier selection has not been certified optimal, so the calculator does not present its bottleneck as a completed minimum.
For a difficult instance, reduce the graph or number of demand rows and try again. A successful run returns a complete bounded optimum and one feasible route witness. The result establishes load balancing for the specified unit requests only; it does not predict delay, queueing behavior, reliability or real network throughput.
A few questions, answered
Can a demand split between routes?
No. Each demand chooses one complete shortest path.
Do reverse traversals share load?
Yes. Both directions use the same undirected edge load.
Are repeated demands duplicates?
No. Repeated demand rows are separate unit requests and count separately.
What does a resource-cap error mean?
The search did not certify an optimum; reduce the instance before retrying.