igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] How to initialize a graph from a (C++) vector of vectors or


From: Przemyslaw Grabowicz
Subject: Re: [igraph] How to initialize a graph from a (C++) vector of vectors or from a vector of links
Date: Fri, 28 Feb 2014 14:53:11 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Thanks, that's helpful, but I forgot to mention that my graph is weighted.

In such case, I should create matrix_t with igraph_matrix_init, fill it with my weights, and create a graph using igraph_weighted_adjacency? (Is there any other option?)

Thanks,
Przemek.


On 28/02/2014 00:05, Gábor Csárdi wrote:
There is no easy way, AFAIK. We could have a matrix view, that handles a chunk of memory as a dense matrix, and if the vector of vectors in C++ is a continuous chunk of memory, then there was an easy way.

But right now, just go over the matrix, put the non-zero edges in an igraph_vector_t and call igraph_create().

Gabor


On Thu, Feb 27, 2014 at 5:14 PM, Przemyslaw Grabowicz <address@hidden> wrote:
Dear all,

I know that igraph is written in C. However, what is the easiest way of creating an igraph graph from an adjacency matrix declared as a vector of vectors or from a list of links declared as a vector in C++?

Thanks,
Przemyslaw Grabowicz.


_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

[Prev in Thread] Current Thread [Next in Thread]