'Tests that a maximal matching is computed correctly
regardless of the order in which nodes are added to the graph.'

def test_ordering(self):

    for nodes in permutations(range(3)):
        G = nx.Graph()
        G.add_nodes_from(nodes)
        G.add_edges_from([(0, 1), (0, 2)])
        matching = nx.maximal_matching(G)
        assert_equal(len(matching), 1)
        assert_true(nx.is_maximal_matching(G, matching))
