We passed in a graph to `sorted_topologically` which didn't have an entry for each node (as we dropped nodes with no edges).