简体   繁体   中英

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.

since you seem to be a beginner, there is a 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM