public class TopologicalSort
extends java.lang.Object
Class that performs topological sort. Topological sort is performed in a way to handle cycles as well: In the case of
cycles, the next node to take is simply the one with the smallest sum of incoming weights left. In this way, in the absence
of cycles normal topological sort is performed, and in the presence of cycles, the sum of reversed edge weights is
minimized.