code: def order_vertices(self):
          
          
          ordered = False
          while ordered == False:
              for i in range(len(self.vertices)):
                  ordered = True
                  for parent in self.vertices[i].parents:
                      if parent>i:
                          ordered = False
                          self.swap_vertices(i, parent)
docs: Order vertices in the graph such that parents always have a lower index than children.