'Test a more complex DAG'

def test_topological_complex(self):

    parent_to_children = {'root': ['A', 'B', 'C', 'E', 'F', 'K', 'O'], 'A': ['D', 'E'], 'B': ['E', 'F', 'G'], 'C': ['H', 'I'], 'D': [], 'E': [], 'F': ['J', 'K'], 'G': ['O'], 'H': ['L'], 'I': [], 'J': [], 'K': ['M', 'N'], 'L': ['O', 'P'], 'M': [], 'N': [], 'O': [], 'P': []}
    child_to_parents = self.get_child_to_parents_map(parent_to_children)
    for _ in range(2):
        self.assertEqual(list(traverse_topologically(start_node='root', get_children=(lambda node: parent_to_children[node]), get_parents=(lambda node: child_to_parents[node]))), ['root', 'A', 'D', 'B', 'E', 'F', 'J', 'K', 'M', 'N', 'G', 'C', 'H', 'L', 'O', 'P', 'I'])
