#NEWLINE# def find_root( self ) : #NEWLINE# #INDENT# 'Finds the index of the root node of the tree.' #NEWLINE# self . find_parents ( ) #NEWLINE# index = 0 #NEWLINE# while ( len ( self . vertices [ index ] . parents ) > 0 ) : #NEWLINE# #INDENT# index = index . vertices [ index ] . parents [ 0 ] #NEWLINE# #UNINDENT# return index