'Returns a list of nodes sorted by WEIGHT or CENTRALITY.
Nodes with a lot of traffic will be at the start of the list.'

def sorted(self, order=WEIGHT, threshold=0.0):

    o = (lambda node: getattr(node, order))
    nodes = ((o(n), n) for n in self.nodes if (o(n) >= threshold))
    nodes = reversed(sorted(nodes))
    return [n for (w, n) in nodes]
