Kahn's Algo Take nodes with in-degree = 0 and add to topological order. Also helps in checking cycle. if the length of the topological array is not equal to the length of input points, then a cycle exists.