'Finds actual-order of the nodes with respect to maximum number of nodes in a rank in component'

def graph_order(self):

    mid_pos = 0.0
    max_level = max(map((lambda x: len(x)), self.levels.values()))
    for level in self.levels:
        if level:
            no = len(self.levels[level])
            factor = ((max_level - no) * 0.1)
            list = self.levels[level]
            list.reverse()
            if ((no % 2) == 0):
                first_half = list[(no / 2):]
                factor = (- factor)
            else:
                first_half = list[((no / 2) + 1):]
                if (max_level == 1):
                    self.result[list[(no / 2)]]['y'] = (mid_pos + ((self.result[list[(no / 2)]]['x'] % 2) * 0.5))
                else:
                    self.result[list[(no / 2)]]['y'] = (mid_pos + factor)
            last_half = list[:(no / 2)]
            i = 1
            for node in first_half:
                self.result[node]['y'] = (mid_pos - (i + factor))
                i += 1
            i = 1
            for node in last_half:
                self.result[node]['y'] = (mid_pos + (i + factor))
                i += 1
        else:
            self.max_order += (max_level + 1)
            mid_pos = self.result[self.start]['y']
