Graph Problem: Transitive closure