[英]Reading wieghted graph using python igraph from adjacency matrix
I have a text file containing the adjacency matrix for my graph. 我有一个文本文件,其中包含图形的邻接矩阵。 Each value in the matrix corresponds to the edge weights between the respective vertex.
矩阵中的每个值对应于各个顶点之间的边缘权重。 How can I read this matrix using igraph package in python so that each edge is given its respective weight.
如何使用python中的igraph包读取此矩阵,以便为每个边缘赋予各自的权重。
since you seem to be a beginner, there is a python-igraph-tutorial . 由于您似乎是一个初学者,因此提供了python-igraph-tutorial 。
You can also find the documentation there and for your specific problem you need the 'Read' method . 您也可以在此处找到文档,对于特定的问题,您需要使用“读取”方法 。 You need to specify a file name and probably the adjacancy parameter.
您需要指定一个文件名,可能还需要指定邻接参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.