I am trying to use the igraph Graph Generator igraph_ring to create a ring lattice, in which each node is connected with n neighbors to the left and right. However, the method does not accept any arguments for the number of edges, i.e. I can only choose whether the edges are directed or not and whether they are mutual (what is the difference??). Is there maybe a way to adjust the number of connections? Thanks, Tartaglia
Asked
Active
Viewed 91 times
0
-
1Post some code: http://stackoverflow.com/help/mcve – Sarang Apr 24 '15 at 16:53
-
I did not post any code, because I am not dealing with any malfunction of the library, it works just fine. I am just wondering if the library offers the functionality of changing the number of edges. This is the definition of the method from the igraph manual: int igraph_ring(igraph_t *graph, igraph_integer_t n, igraph_bool_t directed, igraph_bool_t mutual, igraph_bool_t circular); I implement it like this: int countOfAgents = 5; igraph_integer_t numAgents = countOfAgents; igraph_ring(&g, numAgents, true, false, true); – Niccola Tartaglia Apr 24 '15 at 17:41
-
1I am not sure what you want. Please provide some example input and output. – Gabor Csardi Apr 24 '15 at 18:40
-
So for a ring lattice consisting of n nodes and each node having for instance k=4 distinct friends , I would like node i to be connected to i-2, i-1, i+1, and i+2. So basically each node on that ring, is connected to k/2 neighbors to the left, and k/2 neighbors to the right. – Niccola Tartaglia Apr 24 '15 at 19:00
-
Maybe I have a wrong understanding of what igraph_ring does (or what a ring lattice is). My understanding is, that all the nodes are from i=0 to i=n are sitting in a circle, and each node is connected to its neighbors to the left and right. – Niccola Tartaglia Apr 25 '15 at 15:31
-
Basically, as if I had all my nodes in a vector and let each node connect to the node above it and underneath it, and then connect the beginning and end of the vector. Now all I am wondering is, whether I can set the amount of nodes that each node is connecting to (so instead of connecting to the direct neighbors to the left and right, connect to two (or more) neighbors to the left and right. Does that make sense? – Niccola Tartaglia Apr 25 '15 at 15:31
-
Please read the guidelines on asking questions. Don't explain your question in the comments; just edit the question. No need for "Thanks,
" either. – Jun 04 '15 at 11:07