'Sorts the list of nodes by the i-th value of the contained points.'

def sortByDimension(self, nodes, i):

    decorated = [(node.cargo[i], node) for node in nodes]
    decorated.sort()
    nodes[:] = [node for (_, node) in decorated]
