added method to calculate shortest cycle in an unweighted directed graph.