def testToIGraph(self):
        try:
            import igraph
        except __HOLE__ as error:
            logging.debug(error)
            return

        numVertices = 7
        graph = self.GraphType(GeneralVertexList(numVertices))
        graph.addEdge(1, 1, 0.1)
        graph.addEdge(1, 3, 0.5)
        graph.addEdge(1, 5, 0.5)
        graph.addEdge(3, 5, 0.5)
        graph.addEdge(5, 6, 0.1)

        graph.setVertex(1, "a")
        graph.setVertex(2, "b")
        graph.setVertex(3, "c")

        igraph = graph.toIGraph()

        self.assertEquals(len(igraph.vs), graph.getNumVertices())
        self.assertEquals(len(igraph.es), graph.getNumEdges())

        self.assertEquals(igraph.vs["label"][1], "a")
        self.assertEquals(igraph.vs["label"][2], "b")
        self.assertEquals(igraph.vs["label"][3], "c")

        edges = igraph.get_edgelist()

        i = 0 
        for e in edges:
            self.assertTrue(graph.getEdge(e[0], e[1]) == igraph.es[i]["value"])
            i += 1
dataset/ETHPy150Open charanpald/APGL/apgl/graph/test/MatrixGraphTest.py/MatrixGraphTest.testToIGraph