'Generalized Graph Laplacian'

def test_normalized_laplacian(self):

    GL = numpy.array([[1.0, (-0.408), (-0.408), (-0.577), 0.0], [(-0.408), 1.0, (-0.5), 0.0, 0.0], [(-0.408), (-0.5), 1.0, 0.0, 0.0], [(-0.577), 0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0]])
    Lsl = numpy.array([[0.75, (-0.2887), (-0.2887), (-0.3536), 0.0], [(-0.2887), 0.6667, (-0.3333), 0.0, 0.0], [(-0.2887), (-0.3333), 0.6667, 0.0, 0.0], [(-0.3536), 0.0, 0.0, 0.5, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0]])
    assert_almost_equal(nx.normalized_laplacian_matrix(self.G).todense(), GL, decimal=3)
    assert_almost_equal(nx.normalized_laplacian_matrix(self.MG).todense(), GL, decimal=3)
    assert_almost_equal(nx.normalized_laplacian_matrix(self.WG).todense(), GL, decimal=3)
    assert_almost_equal(nx.normalized_laplacian_matrix(self.WG, weight='other').todense(), GL, decimal=3)
    assert_almost_equal(nx.normalized_laplacian_matrix(self.Gsl).todense(), Lsl, decimal=3)
