Order vertices in the graph such that parents always have a lower index than children.

def order_vertices(self):
        """Order vertices in the graph such that parents always have a lower index than children."""
        
        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)