def testClusteringCoefficient(self):
        numVertices = 3
        numFeatures = 1
        vList = VertexList(numVertices, numFeatures)

        #1st graph - take 3 nodes in a line
        graph = self.GraphType(vList)
        graph.addEdge(0, 1, 2)
        graph.addEdge(1, 2, 5)

        self.assertEqual(graph.clusteringCoefficient(), 0)

        #Now, form a triangle
        graph.addEdge(0, 2, 5)
        self.assertEqual(graph.clusteringCoefficient(), 1)

        #2nd Graph - taken from Newman
        numVertices = 5
        numFeatures = 1
        vList = VertexList(numVertices, numFeatures)
        graph = self.GraphType(vList)
        graph.addEdge(0, 1, 2)
        graph.addEdge(0, 2, 2)
        graph.addEdge(1, 2, 2)
        graph.addEdge(2, 3, 2)
        graph.addEdge(2, 4, 2)

        self.assertEqual(graph.clusteringCoefficient(), float(3)/8)

        #3rd graph - has no edges
        numVertices = 5
        numFeatures = 1
        vList = VertexList(numVertices, numFeatures)
        graph = self.GraphType(vList)

        self.assertEqual(graph.clusteringCoefficient(), 0.0)
dataset/ETHPy150Open charanpald/APGL/apgl/graph/test/MatrixGraphTest.py/MatrixGraphTest.testClusteringCoefficient/original