def __init__(self, graph):
<EOL>if len(graph.independent_vertices) > <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self.graph = graph<EOL>new_order = [<NUM_LIT:0>]<EOL>for i in range(<NUM_LIT:1>, graph.num_vertices):<EOL><INDENT>if (graph.distances[i][new_order] == <NUM_LIT:1>).any():<EOL><INDENT>new_order.append(i)<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>remaining = list(range(len(new_order), graph.num_vertices))<EOL>while len(remaining) > <NUM_LIT:0>:<EOL><INDENT>pivot = remaining.pop()<EOL>if (graph.distances[pivot][new_order] == <NUM_LIT:1>).any():<EOL><INDENT>new_order.append(pivot)<EOL><DEDENT>else:<EOL><INDENT>remaining.insert(<NUM_LIT:0>, pivot)<EOL><DEDENT><DEDENT>self.old_index = np.array(new_order)<EOL>self.new_index = np.zeros(self.old_index.shape, int)<EOL>for i, j in enumerate(self.old_index):<EOL><INDENT>self.new_index[j] = i<EOL><DEDENT>
Initialize a ZMatrix generator

           Argument:
             graph  --  an inseparable molecular graph