Remove dependency on digraph