How this calculation works
Remove as few vertices as possible to make a small directed graph acyclic. The output includes the deletion set and a topological order of every remaining vertex, providing a concrete feasibility certificate. Deleting vertices is kept distinct from deleting individual edges, and the minimum claim comes from exhaustive subset sizes.
min |S| such that G−S is a DAG.A worked example
A directed three-cycle has a cycle before deletion. Removing any one vertex leaves one directed edge and therefore a DAG; the minimum feedback vertex set size is one.
Good to know
Directed simple n≤16, exact vertex subset deletion. Self-loops unsupported; returns one deletion witness and residual topological order.
Reference: Method reference: Minimum feedback vertex set calculator for a directed graph (opens in a new tab) ↗
Break every directed cycle
A directed feedback vertex set intersects every directed cycle. Removing it leaves a directed acyclic graph. It is not enough to delete one vertex from just the first cycle found, because other cycles can remain elsewhere or overlap in a way that changes the best combined choice.
The objective counts removed vertices, not removed edges. Deleting one vertex also removes its incident edges as part of the graph operation, but those edges are not charged separately in this cardinality problem. A minimum feedback-edge set can choose a different structure and is not calculated under the same output label.
The Minimum mean cycle calculator for a directed weighted graph finds the smallest average edge weight among directed cycles. Feedback vertex deletion removes every directed cycle, regardless of whether its weight is positive or negative.
Enter a strict directed topology
Every row is a directed edge from its first endpoint to its second. Zero-based vertex labels range over the declared count, including isolated vertices. Opposite directions are separate edges and can form a directed two-cycle. Duplicate rows and self-loops are outside the simple directed input convention.
A self-loop is itself a directed cycle in broader graph theory, so removing its vertex would be necessary there. This page rejects that unsupported input rather than silently dropping the loop. Optional weights are ignored because the solver minimizes vertex count rather than weighted removal cost.
Check the three-cycle example
For zero→one→two→zero, the empty deletion set leaves a cycle. Removing any single vertex leaves at most a one-edge directed path, which is acyclic. Minimum deletion size is therefore one, although all three singleton choices are equally good witnesses.
A graph that is already a DAG returns zero deleted vertices and a full topological ordering. This is a valid optimum rather than an indication that the search skipped the graph. If there are two disjoint directed triangles, at least one vertex from each must be removed, giving size two.
Read the topological-order certificate
After each candidate deletion, the solver computes incoming degrees among remaining vertices and repeatedly removes a zero-indegree vertex. If every remaining vertex is removed this way, the resulting order places each remaining edge forward. That proves the residual graph has no directed cycle.
If the process gets stuck before listing all remaining vertices, that candidate does not break every cycle. The final output lists only surviving vertices in its order, so missing deleted labels are intentional. Check edges only after excluding those incident to the returned deletion set.
Understand minimum size and tied solutions
Candidate deletion sets are tested in increasing size. Returning the first successful size proves that no smaller set works within the completed finite search. The solver need not enumerate all optimal deletion sets to establish the cardinality, and its selected labels should not be interpreted as uniquely necessary.
A vertex that appears in one minimum witness may be absent from another. Identifying vertices present in every optimum is a separate analysis. Do not treat the returned set as a ranking of vertex importance or a unique set of causal troublemakers in a dependency network.
Use strongly connected components as context
Every directed cycle lies inside a strongly connected component, so those components help locate where deletions might be needed. Merely finding components does not solve the minimum deletion problem within them. A large component can sometimes be made acyclic by one deletion, while a smaller one can require several.
A topological sort of the condensation graph orders components, not the original cyclic vertices within each component. That order is not a substitute for the returned residual certificate. The calculator completes the vertex-removal task itself rather than presenting an SCC partition as a feedback-set answer.
Respect the bounded exact-search scope
The form supports up to sixteen vertices. Its exponential subset enumeration is suitable for educational and small dependency examples, not a performance claim for large control-flow or biological networks. A larger instance requires specialized exact or approximation algorithms with their own clearly stated guarantees.
Removing a dependency vertex can have meanings beyond breaking cycles, such as deleting a task or disabling a component. Costs, mandatory vertices and preservation of connectivity are not modeled. Verify that vertex deletion is actually the operation your application permits before applying the minimum cardinality result.
A few questions, answered
Can a DAG legitimately return zero?
Yes. No vertex needs removal, and the full topological order certifies that result.
Does deleting one edge from a cycle solve this problem?
It solves a different edge-deletion task. This page minimizes the number of vertices removed.
Are the selected vertices uniquely necessary?
Not generally. Multiple minimum feedback vertex sets can exist.
Why are self-loops rejected?
The input contract is a simple directed graph without loops. The solver does not silently ignore an unsupported cycle.