1.安装
终端->pip install igraph->pip install python-igraph->pip install pycairo
pycairo用于绘图;python-igraph用于支持igraph的运行环境
2.使用
import igraph
g=igraph.Graph.Read_GML('Geant2009.gml')
igraph.plot(g)
t.save('Geant2009.png'.format('title'))
扩展:把gml输出成txt格式,得到节点和边
g.write_pajek('Geant2009.txt')