A small repro:
scala> Graph(1 ~> 2, 4 ~> 2, 2 ~> 3, 3 ~> 4, 1 ~> 5).topologicalSort
warning: there was one feature warning; re-run with -feature for details
res0: scala.util.Either[_1.NodeT,_1.TopologicalOrder[_1.NodeT]] forSome { val _1: scalax.collection.Graph[Int,scalax.collection.GraphEdge.DiEdge] } = Right(TopologicalOrder(1, 5))
scala> Graph(1 ~> 2, 4 ~> 2, 2 ~> 3, 3 ~> 4, 1 ~> 5).isCyclic
res1: Boolean = true
A small repro: