Added additional unit tests for has_cycle and topological_sort