def swap_vertices(self, i, j):
store_vertex_i = self.vertices[i]<EOL>store_vertex_j = self.vertices[j]<EOL>self.vertices[j] = store_vertex_i<EOL>self.vertices[i] = store_vertex_j<EOL>for k in range(len(self.vertices)):<EOL><INDENT>for swap_list in [self.vertices[k].children, self.vertices[k].parents]:<EOL><INDENT>if i in swap_list:<EOL><INDENT>swap_list[swap_list.index(i)] = -<NUM_LIT:1><EOL><DEDENT>if j in swap_list:<EOL><INDENT>swap_list[swap_list.index(j)] = i<EOL><DEDENT>if -<NUM_LIT:1> in swap_list:<EOL><INDENT>swap_list[swap_list.index(-<NUM_LIT:1>)] = j<EOL><DEDENT><DEDENT><DEDENT>
Swap two vertices in the tree structure array.
swap_vertex swaps the location of two vertices in a tree structure array. 

:param tree: the tree for which two vertices are to be swapped.
:param i: the index of the first vertex to be swapped.
:param j: the index of the second vertex to be swapped.
:rval tree: the tree structure with the two vertex locations swapped.