code: def find_root(self):
          
          self.find_parents()
          index = 0
          while len(self.vertices[index].parents)>0:
              index = self.vertices[index].parents[0]
          return index
docs: Finds the index of the root node of the tree.