def get_index_by_id(self, id):
for i in range(len(self.vertices)):<EOL><INDENT>if self.vertices[i].id == id:<EOL><INDENT>return i<EOL><DEDENT><DEDENT>raise ValueError('<STR_LIT>')<EOL>
Give the index associated with a given vertex id.