def testGeodesicDistance(self):
        numVertices = 5
        numFeatures = 1
        vList = VertexList(numVertices, numFeatures)
        graph = self.GraphType(vList)

        graph.addEdge(0, 1, 5)
        graph.addEdge(1, 2, 2)
        graph.addEdge(2, 3, 2)
        graph.addEdge(3, 4, 2)
        graph.addEdge(4, 0, 2)

        P = graph.floydWarshall()
        self.assertEquals(graph.geodesicDistance(), 37/15.0)
        self.assertEquals(graph.geodesicDistance(P), 37/15.0)

        #Test a string of vertices
        numVertices = 5
        numFeatures = 1
        vList = VertexList(numVertices, numFeatures)
        graph = self.GraphType(vList)

        graph.addEdge(0, 1, 1)
        graph.addEdge(1, 2, 1)
        graph.addEdge(2, 3, 1)
        graph.addEdge(3, 4, 1)

        P = graph.floydWarshall()
        self.assertEquals(graph.geodesicDistance(), 3/4.0)
        self.assertEquals(graph.geodesicDistance(P), 4.0/3)

        #Test case with isolated node
        numVertices = 5
        numFeatures = 1
        vList = VertexList(numVertices, numFeatures)
        graph = self.GraphType(vList)

        graph.addEdge(0, 1, 1)
        graph.addEdge(1, 2, 1)
        graph.addEdge(2, 3, 1)

        P = graph.floydWarshall()
        self.assertEquals(graph.geodesicDistance(), 2.0/3)
        self.assertEquals(graph.geodesicDistance(P), 2.0/3)

        #Test directed graph
        numVertices = 5
        numFeatures = 1
        vList = VertexList(numVertices, numFeatures)
        graph = self.GraphType(vList, False)

        graph.addEdge(0, 1, 1)
        graph.addEdge(1, 2, 1)

        P = graph.floydWarshall()
        self.assertEquals(graph.geodesicDistance(), 4.0/25)
        self.assertEquals(graph.geodesicDistance(P), 4.0/25)
dataset/ETHPy150Open charanpald/APGL/apgl/graph/test/MatrixGraphTest.py/MatrixGraphTest.testGeodesicDistance/swapped operands of `/`