'Graph Laplacian'

def test_laplacian(self):

    NL = numpy.array([[3, (-1), (-1), (-1), 0], [(-1), 2, (-1), 0, 0], [(-1), (-1), 2, 0, 0], [(-1), 0, 0, 1, 0], [0, 0, 0, 0, 0]])
    WL = (0.5 * NL)
    OL = (0.3 * NL)
    assert_equal(nx.laplacian_matrix(self.G).todense(), NL)
    assert_equal(nx.laplacian_matrix(self.MG).todense(), NL)
    assert_equal(nx.laplacian_matrix(self.G, nodelist=[0, 1]).todense(), numpy.array([[1, (-1)], [(-1), 1]]))
    assert_equal(nx.laplacian_matrix(self.WG).todense(), WL)
    assert_equal(nx.laplacian_matrix(self.WG, weight=None).todense(), NL)
    assert_equal(nx.laplacian_matrix(self.WG, weight='other').todense(), OL)
