def testNormalisedLaplacianSym(self):
        numVertices = 10
        numFeatures = 0

        vList = VertexList(numVertices, numFeatures)
        graph = self.GraphType(vList)
        graph.addEdge(0, 1)
        graph.addEdge(0, 2)
        graph.addEdge(0, 9)
        graph.addEdge(1, 1)
        graph.addEdge(1, 5)

        L = graph.normalisedLaplacianSym()

        W = graph.getWeightMatrix()
        L2 = numpy.zeros((numVertices, numVertices))
        d = graph.outDegreeSequence()

        for i in range(numVertices):
            for j in range(numVertices):
                if d[i] != 0 and d[j]!= 0:
                    Wij = W[i, j]/(numpy.sqrt(d[i]*d[j]))
                else:
                    Wij = 0

                if i == j:
                    L2[i, j] = 1 - Wij
                else:
                    L2[i, j] = -Wij

        tol = 10**-6
        self.assertTrue(numpy.linalg.norm(L2 - L) < tol)
dataset/ETHPy150Open charanpald/APGL/apgl/graph/test/MatrixGraphTest.py/MatrixGraphTest.testNormalisedLaplacianSym/original