Correct a slight imperfection in the code (only edges TO and FROM should be considered in each case, not all edges that connect a given node)
Make another diagram test pass.