An All-in-One DAG Toolkit

made and submitted by vaibhavsagar
This algorithm tells you if a given directed graph is acyclic or not and simultaneously puts its vertices into the most convenient order for processing, all in linear time!