'Negative weights'

def test_negative_weights(self):

    G = nx.Graph()
    G.add_edge(1, 2, weight=2)
    G.add_edge(1, 3, weight=(-2))
    G.add_edge(2, 3, weight=1)
    G.add_edge(2, 4, weight=(-1))
    G.add_edge(3, 4, weight=(-6))
    assert_equal(nx.max_weight_matching(G), {1: 2, 2: 1})
    assert_equal(nx.max_weight_matching(G, 1), {1: 3, 2: 4, 3: 1, 4: 2})
