'Get a list of all nodes sorted in an optimal traversal order.
:param iterable nodes: A collection of nodes to sort. If none, all nodes in the graph will be used to sort.
:return:               A list of sorted nodes.
:rtype:                list'

def sort_nodes(self, nodes=None):

    raise NotImplementedError()
