How this calculation works
Find a minimum-cost directed spanning subgraph that remains strongly connected, with reachability witnesses.
min Σ_a∈A′ c_a subject to (V,A′) strongly connected; ties minimize |A′|.A worked example
The three unit-cost arcs 0→1→2→0 retain mutual reachability at cost three. The extra cost-two arcs are unnecessary.
Good to know
Strongly connected simple directed graph on 1–7 vertices, at most 18 arcs, nonnegative costs at most 10^6. Exact arc subsets; primary objective retained cost, tie objective arc count. Unit costs minimize retained arc count.
Retain mutual directed reachability
A strongly connected spanning subgraph keeps all original vertices and enough directed arcs that every vertex can reach every other vertex. The calculator minimizes the total cost of the retained arcs. If several subgraphs tie in cost, it prefers the one using fewer arcs as a secondary objective.
This is a deletion problem on an already directed graph. An arc cannot be reversed or created to repair connectivity. The chosen subgraph must use only entered arc identities, and strong connectivity must hold after every omitted arc has been removed. Connectivity in the underlying undirected graph is not sufficient.
Compare this with the Strong orientation calculator for a bridgeless undirected graph. Delete the fewest or cheapest directed arcs while retaining strong connectivity;orienting all edges of an undirected graph has a different input and objective.
Enter costs and arc directions
Every row contains a source, destination and nonnegative cost. Labels are zero-based and every declared vertex remains part of the optimization, even if it would be convenient to discard it. Reverse arcs are separate permitted entries, whereas repeating an identical directed arc is rejected as a duplicate.
The original graph must already be strongly connected; deleting arcs cannot create a missing directed route. A single vertex with no arcs is accepted and needs cost zero. Up to seven vertices and eighteen arcs are supported, making an exhaustive comparison possible without implying a scalable large-network optimization method.
Follow the directed cycle example
The default graph includes the three unit-cost arcs zero to one, one to two and two to zero. Together they form a directed cycle through every vertex. Starting anywhere on that cycle reaches each other vertex, so the three retained arcs provide an immediately inspectable feasible spanning subgraph.
Every vertex in a strongly connected directed graph with more than one vertex needs at least one outgoing arc. The example therefore needs at least three arcs, and each available arc costs at least one. The unit-cost cycle attains the resulting lower bound of three, while the two extra arcs can be deleted.
Enumerate feasible arc subsets
The search examines subsets of the entered directed arcs, ignoring subsets too small to provide an outgoing arc at every vertex when more than one vertex exists. It sums retained costs and tests strong connectivity only when the candidate can improve the best objective pair found so far.
Reachability from one starting vertex is tested in both the candidate graph and its reversal. Passing both tests means the start can reach every vertex and every vertex can reach the start. Concatenating those routes establishes reachability between any ordered pair, so these two traversals certify strong connectivity.
Check the retained network certificate
The output lists the chosen arcs, their total cost and their count. Sum the listed costs to verify the primary objective. The reachability records then show, for each source vertex, every vertex reached using only the retained arcs. Each such list must cover the complete declared vertex set.
A feasible reachability certificate does not alone show that the cost is minimal; that conclusion also depends on completion of the bounded subset search. If a different retained network has the same cost and arc count, it is equally good under this objective, even when its routes and path lengths look quite different.
Choose the right cost interpretation
Using cost one for every arc makes the objective the number of retained arcs. Other nonnegative costs can represent maintenance expense or another additive retention penalty. Zero-cost arcs are allowed, and the secondary arc-count rule removes needless zero-cost arcs whenever doing so preserves an equally cheap strongly connected subgraph.
Minimizing retained cost is equivalent to maximizing deleted cost when the original total is fixed. It does not minimize the number of deletions. Keeping more arcs may give shorter routes or more redundancy, but neither benefit enters this objective unless it has been translated into another explicit constraint or a different model.
Understand the narrow guarantee
At most eighteen arcs produce a finite family of subsets that can be enumerated completely. Costs are ordinary finite numerical values, and the calculator returns one optimum rather than every tied subgraph. The result is about directed reachability, not resilience after an additional failure or a requirement for multiple independent routes.
For reliability planning, inspect whether the chosen optimum contains a single critical cycle or a sparse bottleneck. Those structures are allowed here because one route is enough for strong connectivity. Requiring fault tolerance, minimum capacities or bounded travel times changes the feasible set and should not be inferred from the retained-cost certificate.
A few questions, answered
How do I minimize the number of retained arcs?
Give every arc cost one. The retained cost then equals its arc count.
Are reverse arcs interchangeable?
No. Each ordered pair has its own direction and cost.
Can an initially non-strong graph be repaired?
No. Deleting arcs cannot create missing reachability, so such input is rejected.
Are zero costs allowed?
Yes. Equal total costs are resolved by preferring fewer retained arcs.