[graph-tool] Adjancymatrix graphcreation

Tiago de Paula Peixoto tiago at skewed.de
Thu Mar 13 11:36:38 CET 2014

On 03/12/2014 05:28 PM, v k wrote:
> Hey folks,
> Is there an efficient way to create a graph out of a sparse adjancy
> matrix? Otherwise my idea is rather to use np.nonzero and iterate over
> it all, but it didnt naive to me.

There is not built-in function for this. All you need to do is to
iterate over the nonzero entries, and call Graph.add_edge().


Tiago de Paula Peixoto <tiago at skewed.de>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <https://lists.skewed.de/pipermail/graph-tool/attachments/20140313/26e77903/attachment.asc>

More information about the graph-tool mailing list