'Initialize orders the nodes in each rank with depth-first search'

def init_order(self, node, level):

    if (not self.result[node]['y']):
        self.result[node]['y'] = self.order[level]
        self.order[level] += 1
    for sec_end in self.transitions.get(node, []):
        if (node != sec_end):
            self.init_order(sec_end, self.result[sec_end]['x'])
