예제 #1
0
 def testRankedList(self): 
     graph = igraph.Graph(directed=True)        
     graph.add_vertices(5)
     
     graph.add_edges([(0,1), (0,2), (1, 3), (2,3), (2,4)])   
     graph.es["invWeight"] = [1, 1, 1, 1, 1]
     graph.es["weight"] = [1, 1, 1, 1, 1]
     
     ranker = GraphRanker()
     outputList = ranker.vertexRankings(graph, [0, 1, 2])
     
     
     for lst in outputList:
         self.assertEquals(set(lst), set([0, 1,2])) 
         self.assertEquals(len(lst), 3)