'Tests that computing the longest path does not depend on
nodes being orderable.
For more information, see issue #1989.'

def test_unorderable_nodes(self):

    class Unorderable(object, ):
        def __lt__(self, other):
            error_msg = '<    not    supported    between    instances    of    {}    and    {}'.format(type(self).__name__, type(other).__name__)
            raise TypeError(error_msg)
    nodes = [Unorderable() for n in range(4)]
    G = nx.DiGraph()
    G.add_edge(nodes[0], nodes[1])
    G.add_edge(nodes[0], nodes[2])
    G.add_edge(nodes[2], nodes[3])
    G.add_edge(nodes[1], nodes[3])
    nx.dag_longest_path(G)
