Re: [igraph] Choosing between different methods of detecting communities

2012-10-03 Thread Tamás Nepusz
> I am not sure, because the results are different from the same algorithm in > SNAP, which also implement Girvan-Newman's algorithm while only unweighted > version. The edge betweenness algorithm is not deterministic in the sense that it is free to make a (possibly random) choice when there ar

Re: [igraph] Choosing between different methods of detecting communities

2012-10-03 Thread Tamás Nepusz
> I know that the algorithm is not deterministic. In my case, the graph only > have tens of nodes, while the results are very different. > In igraph, the unweighted version results in only one community; in SNAP, > there are quite a few communities. How does SNAP select the number of communitie

Re: [igraph] parallel processing

2012-10-09 Thread Tamás Nepusz
Hi, Well, I'm not too familiar with either of these packages so I don't know anything about its internals, but here are a few things to consider: 1. You cannot modify the same variable in multiple parallel execution branches. For instance, even the following simple function does not work in pa

Re: [igraph] parallel processing

2012-10-09 Thread Tamás Nepusz
> It was a simplification of my program. I have a data set of network with > quite 43,000,000 edges stored in a special unusual format. I myself should > make an empty graph and append edges. the process is very high and It takes > too long if I want to do sequentially. > The problem lies not

Re: [igraph] rewire() and self loops

2012-10-12 Thread Tamás Nepusz
Hi Dov, I have recently fixed this in the development branch. If you wanna give it a go and don't mind compiling it yourself, check out the nightly build tomorrow: http://code.google.com/p/igraph/downloads/list Revision 3006 of the 0.7-main tree should include all the changes -- this will be

Re: [igraph] plot: edges cross vertexes

2012-10-13 Thread Tamás Nepusz
Hi Sam, The primary purpose of supporting curved edges is to ensure that multiple edges between the same node pairs are all visible. igraph does not try to set the curvature of edges to avoid other nodes (and I guess it would be quite complicated anyway if you take into account that nodes may

Re: [igraph] Page rank calculation

2012-10-16 Thread Tamás Nepusz
> > I want to calculate page rank centrality for several networks but in some of > them I got this error message : > what does it mean and how I can solve it? Usually this means that there is something "pathological" in your graph. Send me a few example graphs that do not work for you and I'll t

Re: [igraph] Distance along a road

2012-10-16 Thread Tamás Nepusz
> I am not familiar with shapefiles, though, so I don't know how to > convert them to igraph. I'm not sure either, but one possible way to go would be to 1) load the shapefiles package in R 2) read your shapefile and convert it to a plain data frame using convert.to.simple 3) depending on how the

Re: [igraph] vcount() shows one more node than existing one ??

2012-10-23 Thread Tamás Nepusz
> More probably I am mistaking, but I loaded an edge list graph > (graph<-read.graph("graph.txt", format="edgelist",0, TRUE), with 7 > nodes but vcount(..) shows me 8 (nodes). > The nodes in my graph are identified by a numeric number 1-7 (graph > is shown in below). igraph uses zero-based vertex

Re: [igraph] adding weights after graph.union.by.name

2012-10-25 Thread Tamás Nepusz
> I am facing problems with `igraph_sparsemat() function. Could it be the problem that your sparse_g variable is essentially a dangling pointer that points nowhere? You should _create_ a sparse matrix first and then pass the address of that sparse matrix to igraph_sparsemat. -- T. ___

Re: [igraph] Sorting a graph or assigning attributes based on vertex names

2012-10-30 Thread Tamás Nepusz
Hi, First I would try replacing set.vertex.attribute(g, "bucket", vid, bv[i]) with: V(g)$bucket[vid] <- bv[i] I think this avoids copying the graph. Also, I would even try this (not sure if it works, but it's worth a try): V(g)$bucket[sortedVertexIDs] <- bv This would apply all the bucket vec

Re: [igraph] Compiling igraph with the Intel compilers

2012-10-31 Thread Tamás Nepusz
Malcolm, Add the following line to the foreign-*-parser.y files somewhere below the includes: char* stpcpy(char* s1, const char* s2); This did the trick for me. Best, Tamas On 31 Oct 2012, at 16:47, Malcolm Tobias wrote: > Gabor, > I tried what you recommended, but I'm still getting an erro

Re: [igraph] Max size of graph in igraph

2012-11-01 Thread Tamás Nepusz
> Is there an upper limit on graph size for plot operations in igraph? No, there isn't, apart from the working memory of your system. > Python hangs with a “BEX” error message (buffer overflow?) when graph objects > grow in size. I've never heard about such an error message -- what operating syst

Re: [igraph] Max size of graph in igraph

2012-11-01 Thread Tamás Nepusz
> Tamas will know this better, but how big is your graph? Here is an > example with ~70,000 nodes and ~4 million edges, so if your graph is > smaller than this, then graph size is not a problem: > http://sixdegrees.hu/last.fm/ Well, this figure was created with a custom plotting routine, not the on

Re: [igraph] Compiling igraph with the Intel compilers

2012-11-01 Thread Tamás Nepusz
For the record: we have managed to resolve the issue with the Intel compilers, so the 0.6 tree should compile with icc from revision 3000 onwards. Similarly, the first revision in the development (0.7) tree that supports icc is revision 3043. Those who do not want to check out the full source t

Re: [igraph] Contracting two vertices into one in Igraph - error

2012-11-08 Thread Tamás Nepusz
> And after I pick two nodes, say 25, 26, which have multiple edges between > them, I'm trying to merge them into a single vertex: The right contraction vector in this case is: c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,25) The reason is as follows. In the contraction ve

Re: [igraph] Constraint

2012-11-08 Thread Tamás Nepusz
Dear Mandy, As far as I know, Burt's constraint scores can be calculated on an undirected graph without problems; even the R manual page for the constraint() function uses an undirected graph in the example: http://igraph.sourceforge.net/doc/R/constraint.html If you think you are getting incor

Re: [igraph] Contracting two vertices into one in Igraph - error

2012-11-08 Thread Tamás Nepusz
> Of the vertices 1:26, I can also choose two nodes that are not consecutive, > as in, I can choose to merge (1,5) or (7,18) into a single vertex. Can this > be done? Quoting myself: > In general, if you want to merge vertex v into vertex u (assuming that v > > u), you will need a contraction

Re: [igraph] walktrap membership help

2012-11-15 Thread Tamás Nepusz
Hi, > I just started out with iGraph in the python interface, I have trouble > printing out the membership of the community_walktrap. The walktrap method does not give you a membership vector, it gives you a dendrogram instead (since it is a hierarchical clustering method). You must "cut" the d

Re: [igraph] filter graph based on degree + x, y coordinates has node attributes

2012-11-15 Thread Tamás Nepusz
Hi, You did not mention whether you are working with igraph in C, R or Python so I can give you only some generic ideas: > I want to filter a graph that I made. If a vertex has a degree 1 and is > connected to another vertex who has also got degree 1 -> delete both vertices > (and also the cor

Re: [igraph] Problems compiling igraph 0.6 on MacOS X

2012-11-16 Thread Tamás Nepusz
Hi, > I noticed that new tarballs were added yesterday. Just to let you know that > the problems with compiing on OSX (R version 2.15.2) remain. Would you know > the most recent useable tarball that has the revision to alpha centrality > included? Many thanks. I have just uploaded a tarball of

Re: [igraph] missing links of subgraphs

2012-11-17 Thread Tamás Nepusz
Hi, > sub_graph <- induced.subgraph(graph=g_n1, v=unlist(fg_communities[k])) Can you let us know what does fg_communities contain when you issue this command? Even better, can you send us a small, self-contained example that reproduces the problem? Best, Tamas

Re: [igraph] missing links of subgraphs

2012-11-17 Thread Tamás Nepusz
n more clear in my explanation. > > Thank you again. > > Best, > > Matteo > > 2012/11/17 Tamás Nepusz : >> Hi, >> >>> sub_graph <- induced.subgraph(graph=g_n1, v=unlist(fg_communities[k])) >> Can you let us know what does fg_communities

Re: [igraph] Error when loading the tkcl interface

2012-11-17 Thread Tamás Nepusz
Hi, Have you tried upgrading R and XQuartz to their most recent versions? For the record, I'm using R 2.15.1 and XQuartz 2.7.4 (xorg-server 1.13.0) and it works fine for me. Cheers, Tamas On 17 Nov 2012, at 18:46, Silvia SM wrote: > Hello, > > Maybe someone can help me. I just switch to Ma

Re: [igraph] Problems compiling igraph 0.6 on MacOS X

2012-11-19 Thread Tamás Nepusz
nce would be appreciated. > > Kind regards, > Bob > > On 17 November 2012 00:51, Tamás Nepusz wrote: > Hi, > > > I noticed that new tarballs were added yesterday. Just to let you know that > > the problems with compiing on OSX (R version 2.15.2) remain. Would you k

Re: [igraph] Problems compiling igraph 0.6 on MacOS X

2012-11-19 Thread Tamás Nepusz
alled package can be loaded > > * DONE (igraph) > > Once again many thanks for your help. > > Kind regards, > Bob > > On 19 November 2012 11:10, Tamás Nepusz wrote: > Hi Bob, > > This seems to be an issue that is specific to your machine as I cannot > reprodu

Re: [igraph] Problems calculating shortest paths for sparse large graph

2012-11-21 Thread Tamás Nepusz
> I also tried to ignore the weights, by using the option > "weights=E(net)$NA", but it didn't work. You should use weights=NA if you want to ignore the weights (as far as I know). Also, do you happen to have any pathological weights in your graph (like negative weights or zeros)? -- T. _

Re: [igraph] average path length for graphs containing multiple components

2012-11-21 Thread Tamás Nepusz
Hi, > how is the average path length calculated for graphs that contain more than > one component? Depending on the value of the "unconn" parameter of the function, there are two possible behaviours: - If "unconn" is False, igraph simply assumes for every disconnected vertex pair that their d

Re: [igraph] average path length for graphs containing multiple components

2012-11-21 Thread Tamás Nepusz
> Hi, I solved this by myself.. Great! :) Now, if you want to generalize it to weighted graphs, there are at least two possible ways: either you calculate the average weight of the shortest paths or you still calculate the average path length but take the weights into account when you calculate

Re: [igraph] average path length for graphs containing multiple components

2012-11-21 Thread Tamás Nepusz
> It's nice to know that the function "get_shortest_paths" support weights. So, > the formula should be something like the following: Basically yes, but it would probably be more scalable to calculate the path lengths for the vertices one by one (in g.shortest_paths) because this way you don't h

Re: [igraph] Problems calculating shortest paths for sparse large graph

2012-11-21 Thread Tamás Nepusz
> I am trying to calculate the shortest paths for a large sparse graph > (48000 nodes and 2000 edges). [...] > shortest_paths<-shortest.paths(net,weights=E(net)$weight); > Error in .Call("R_igraph_shortest_paths", graph, v - 1, to - 1, > as.numeric(mode), : > negative length vectors are not allow

Re: [igraph] edge.label is not readable on igraph

2012-11-22 Thread Tamás Nepusz
> I have anohter question relating to this. I like to use start layout but I > like the edge.arrow to reverse directions. For exampe rather thatn doing this > <-- I like to this ->, any ideas? Use the edge.arrow.type parameter. From the documentation: "This parameter can be used to speci

Re: [igraph] potential revamp of power.law.fit implementation

2012-11-27 Thread Tamás Nepusz
Dear Bob, Thanks for the feature request. As a matter of fact, I also have my own C implementation of the Clauset-Shalizi-Newman method (see http://github.com/ntamas/plfit for a standalone version) and its igraph integration has been on my TODO list for a long time -- unfortunately I never got

Re: [igraph] Fastgreedy Algorithm for Community Detection in igraph for RStudio - fatal error.

2012-11-28 Thread Tamás Nepusz
Hi, > Is it possible, that I have a newer version of igraph or RStudio, which is > not compatible with the fastgreedy alg.? What can I do? I strongly suspect that the problem lies in RStudio itself because all the community detection algorithms work perfectly fine for me if I use them from the

Re: [igraph] Fastgreedy Algorithm for Community Detection in igraph for RStudio - fatal error.

2012-11-28 Thread Tamás Nepusz
Hi, > g_adjacency_undirected_weighted_connected <- > graph.adjacency(adjacency_matrix_undirected_unweighted_connected) The graph you create here will be directed because graph.adjacency creates directed graphs by default. Add mode="undirected" to make the graph undirected. Other than that, your

Re: [igraph] Comparing large graphs

2012-12-04 Thread Tamás Nepusz
> If I remember right, some months ago somebody posted here about > measures to compare networks. I looked for this post in the historial > of the list, but I didn't find it, sorry. This is a thread that seems related, although it is quite old: http://lists.gnu.org/archive/html/igraph-help/2008-04

Re: [igraph] Comparing large graphs

2012-12-05 Thread Tamás Nepusz
> First, I was wondering if Igraph considers IGRAPH_INFINITY as zero or > as other value. IGRAPH_INFINITY is infinity, period. It is there only to provide us with a sort-of-platform-independent way to refer to infinity. > I am working with shortest-paths matrices and I would > like the distance b

Re: [igraph] getting k-connected nodes from a vertex

2012-12-08 Thread Tamás Nepusz
> "The neighborhood of a given order o of a vertex v includes all vertices > which are closer to v than the order. Ie. order 0 is always v itself, order > 1 is v plus its immediate neighbors, order 2 is order 1 plus the immediate > neighbors of the vertices in order 1, etc.", is order 1 yielding "i

Re: [igraph] Problems reading the number of vertices of a pajek-file using C-Igraph in a 64-bits machine

2012-12-10 Thread Tamás Nepusz
Dear Charles, > number of vertices of a network from in simple pajek file. The program > compiles correctly, it reads the edges of the network correctly, but > it reads the number of vertices like a strange number, like -10585152. I'm 99% sure that this is a printing/formatting issue, i.e. the num

Re: [igraph] all eigenvector centrality

2012-12-14 Thread Tamás Nepusz
> I used eigen() but It did not work on large networks. I got memory > allocation error. This is because eigen() would calculate all the eigenvectors -- guess that takes a lot of memory ;) > According to below links, "nev" parameter determines the number of required > eigenvectors and "which"

Re: [igraph] Issues trying to get tree using layout.reingold.tilford

2012-12-15 Thread Tamás Nepusz
> I'm trying to use R igraph to get x,y coordinates to plot vertices in another > application. The data should show a simple organisation chart, hence the > desire for a top-down tree. > [...] > Looking at l I get something similar to: > > [,1] [,2] > [1,] 0.00e+00

Re: [igraph] Adding shortcuts to the Small Word model without rewiring the edges

2012-12-19 Thread Tamás Nepusz
> bmat2<-matrix(rbinom(100,1,0.1),100,100)##Source of the > problem You probably need matrix(rbinom(100*100, 1, 0.1), 100, 100), otherwise all the columns in the matrix will be equal (because the elements generated by rbinom are enough only for the first column). Also, note that

Re: [igraph] Community similarity / dissimilarity

2012-12-19 Thread Tamás Nepusz
Hi, > I'm trying to identify a good distance (similarity / dissimilarity) > measure for discovered VertexDendrogram and VertexClustering > communities Would you like to compare two communities, or to compare two community structures as a whole? For the latter, we have a function called compare_c

Re: [igraph] Community similarity / dissimilarity

2012-12-19 Thread Tamás Nepusz
> vc = g.community_infomap() You could try the following: g2 = g.copy() g2.contract_vertices(vc.membership) g2.es["weight"] = 1 g2.simplify(combine_edges="sum") This would give you a graph where the nodes represent the communities of the original graph, the edges are weighted, and the weight of

Re: [igraph] all_pairs shortest path

2012-12-20 Thread Tamás Nepusz
> G = igraph.Graph(directed = True) > > 1) Adding edges: > G.add_edge([(1,2)]) > G.add_edge([(1,2)]) > if I add twice the same edges, my digraph keeps two occurence of the same > edges in G.get_edgelist: [(1, 2), (1, 2)] Why is that a problem? If you add the edge twice, of course you are going to

Re: [igraph] slow rewire performance after subsetting a graph

2012-12-21 Thread Tamás Nepusz
Hi Murat, So I've spent a bit of time with debugging and here's the explanation. It's a long story. First of all, H in your example is not a clone of G in any sense; it is a completely independent object, so that's not the issue here. Second, igraph's internal data structures are optimized for

Re: [igraph] time complexity of centrality calculation

2012-12-25 Thread Tamás Nepusz
> I need to compare time complexity of computing different centrality measures > in igraph but I could not find how they are implemented exactly. The documentation of the C core of igraph lists the time complexity of most of the functions: - Degree: http://igraph.sourceforge.net/doc/html/ch04s0

Re: [igraph] Transitivity

2012-12-27 Thread Tamás Nepusz
Hi, > I therefore used transitivity function in igraph, and for my graph I've got > the value: 0.5493 (global), 0.42 (average). > Reading the previous mail called "Small worlds in igraph", I think the > "global" is best for what I want to show. > I also compared my results using 2 others softwar

Re: [igraph] shortest_path for directed graphs

2012-12-28 Thread Tamás Nepusz
Yes, if G.is_directed() returns True, then G.shortest_paths() will take edge directions into account. Use the mode=... keyword argument to override that. See the docstring of G.shortest_paths() for more details. This applies also to the other shortest path functions, not only G.shortest_paths()

Re: [igraph] changing the font and size of the main (igrpah title)

2013-01-05 Thread Tamás Nepusz
Seems like this question is answered already on Stack Overflow: http://stackoverflow.com/questions/14164887/change-the-font-and-colour-of-the-igraph Basically, get rid of the "main=..." argument and use the title() command instead: title("This is my first igraph", cex.main=3, col.main="green")

Re: [igraph] circle shape

2013-01-11 Thread Tamás Nepusz
> first part works, second part (layout) no. It kindly ask me how I want to > close R... but that'll do great for now. Oh darn, I forgot that layout.graphopt is having some problems in igraph 0.6 under R. Use any other layout function (e.g., layout.fructerman.reingold, layout.kamada.kawai etc) a

Re: [igraph] Unable to save graphml file

2013-01-11 Thread Tamás Nepusz
Hi, Could be a bug but I'm not sure and unfortunately we don't have any Windows 7 machines to test on. Can you please try it with other formats (e.g., write_ncol, write_gml and so on)? Does it work with them or do you get empty files? Also, can you please try this: f = open("gf.graphml") fg.w

Re: [igraph] Unable to save graphml file

2013-01-12 Thread Tamás Nepusz
> I switched to Python 2.7 and I am now able to save graphml, ncol, and gml > files. Okay, that's good, so the issue is related to Python 3.x only. Quite a few things changed in the Python 3 API related to file handling so I'll start digging there. (Hopefully I can reproduce the issue on Windows

Re: [igraph] Exception when trying to call count_subisomorphisms_vf2

2013-01-18 Thread Tamás Nepusz
> I’m experimenting with Graph.count_subisomorphisms_vf2 to see if it will do > what I need it to do. I’m starting with a very simple call (assume g1 and g2 > are instances of igraph.Graph): > > countMatches = g1. count_subisomorphisms_vf2(g2) > > When I execute this I get the

Re: [igraph] igraph memory error

2013-01-18 Thread Tamás Nepusz
> I have a graph with 23379 edges and 23295 vertices. It is a simple, > unconnected graph with 917 distinct clusters and a density of 4.26x10^-5. > I am able to load the graph without a problem. However, I need to calculate > shortest paths using R so that I can run a series of simulations and

Re: [igraph] igraph-help Digest, Vol 78, Issue 9

2013-01-18 Thread Tamás Nepusz
> I need to calculate the shortest paths for all Okay, so you actually need the shortest paths and not only their lengths. > in order to run the simulation code that follows, but I am only interested in > shortest paths which are 6 degrees or less. > Is there a way to specify sp<=6 No, there isn'

Re: [igraph] igraph-help Digest, Vol 78, Issue 10

2013-01-27 Thread Tamás Nepusz
Hi, > For (deg in 1:6) ( > Loc <-which (sp==deg) > [...] > I get the following error message: > > Error in which (sp == deg): cannot allocate memory block of size 2.0 GB > > Does anyone know what a "memory block" is? Or, how to increase the size > allocated to a memory block? The message simpl

Re: [igraph] evcent function gives all zero vectors

2013-01-29 Thread Tamás Nepusz
> I observed that in the graph which i'm currently analysing, if I were to run > the evcent function with the arguement for directed set as true, the vectors > generated are all zeros. > Is this normal? Does not seem to be so; send me the graph (in private, not to the mailing list) so I can tak

Re: [igraph] Incorrect theoretical max for betweenness calculation on large networks

2013-01-29 Thread Tamás Nepusz
Hi, Thanks for the bug report. It seems that the C core of igraph does not have this error so the problem is in the glue code that bridges the gap between the C core and R itself. Gabor will probably fix it soon (if it is not fixed already in the development tree). In the meanwhile, you can wor

Re: [igraph] igraph and Iron Python?

2013-02-01 Thread Tamás Nepusz
AFAIK IronPython is written in C#, therefore it cannot load any Python extensions that are implemented in C. This applies to igraph as well since igraph is mostly a C library and the Python module is "just" a wrapper around the C core. In other words, the Python module of igraph is only compatib

Re: [igraph] trying to translate redundancy measure for bipartite graph from python

2013-02-01 Thread Tamás Nepusz
> is there any combinations() in r? something that explore all possible > combinations in a vector - as far as I have understood it... expand.grid could be the function you are looking for. -- T. ___ igraph-help mailing list igraph-help@nongnu.org htt

Re: [igraph] trying to translate redundancy measure for bipartite graph from python

2013-02-01 Thread Tamás Nepusz
> I am trying: > expand.grid(neighbors(g,1)) Try this: neis <- neighbors(g, 1) expand.grid(neis, neis) -- T. ___ igraph-help mailing list igraph-help@nongnu.org https://lists.nongnu.org/mailman/listinfo/igraph-help

Re: [igraph] install on Ubuntu?

2013-02-04 Thread Tamás Nepusz
> Reading package lists... Done > Building dependency tree > Reading state information... Done > E: Unable to locate package igraph-python Judging from the error message, you wrote "sudo apt-get install igraph-python" and not "sudo apt-get install python-igraph". > I've tried to install ca

Re: [igraph] install on Ubuntu?

2013-02-04 Thread Tamás Nepusz
> Using Ubuntu 11.04 64 bit at the moment but have tried the same in Ubuntu > 12.10 64 / 32 Ah, that must be the reason. Ubuntu 11.04 is unsupported; the repo contains packages for Ubuntu Quantal (12.10) and Precise (12.04) only. Are you sure that it did not work in Ubuntu 12.10? Best, Tamas __

Re: [igraph] install on Ubuntu?

2013-02-04 Thread Tamás Nepusz
> pretty sure but let me try right now. thank goodness for virtual machines! > would there be an issue with either 64 bit or 32 bit versions? There shouldn't be any; I'm using python-igraph regularly on Ubuntu 12.10. -- T. ___ igraph-help mailing list

Re: [igraph] Negative weights in betweenness centrality calculation

2013-02-06 Thread Tamás Nepusz
> I am wondering how the betweenness centrality calculation work on the > negative weights values. Chances are that it won't. Betweenness centrality calculates all the shortest paths in the network (where "shortest" means "having smaller total weight") and then counts how many times a given edge

Re: [igraph] Problem with edge weights after rewire()

2013-02-07 Thread Tamás Nepusz
Dear Matthias, > After applying ``rewire()`` the edge values are replaced by 'None'. Does the > rewire function allow for randomization of weighted networks at all? Well, yes, with a little trick. The ``rewire()`` function does not preserve edge attributes yet, but you can "back them up" in a va

Re: [igraph] random weighted graphs

2013-02-10 Thread Tamás Nepusz
> I tried using rewire.edges from R igraph 0.6 package, but found out that the > generated random graphs had almost the same edge weights as that of my > original graph. How do you define the edge weights in the randomized graph? > So, if someone could point out how to estimate if there is a

Re: [igraph] Rewire in general

2013-02-10 Thread Tamás Nepusz
Hi Nina, > I was just reading some requests to change the rewire-function: I am also in > trouble because I need a fast rewiring method that maintains the (directed) > degree distribution and AVOIDS self-loops. I noticed that in November 2012 > somebody actually wanted the rewiring to include self

Re: [igraph] random weighted graphs

2013-02-10 Thread Tamás Nepusz
> I got your point. My graphs are "biological", generated from a set of > biological experimental data and database information, so each node > corresponds to a gene, so I would say that node ID in my case not an > arbitrary property and has meaning behind it. Ah, understood. Anyway, I would sti

Re: [igraph] Different results from fastgreedy.community on different systems

2013-02-11 Thread Tamás Nepusz
> I am doing some research on networks and I find that fastgreedy.community > returns different results when run on different PC. fastgreedy.community is not fully deterministic because the original algorithm does not specify what should happen when more than one possible merge of communities wo

Re: [igraph] Neighbors & Degree not matching

2013-02-12 Thread Tamás Nepusz
> In the code/output below Node 153 has one neighbor (Node 156) but the degree > function returns 2. Does anyone know why this would happen? Your graph is directed and node 153 has an outgoing and an incoming edge. degree() returns the "undirected" degree by default, i.e. it counts both the inco

Re: [igraph] Definition of Modularity

2013-02-13 Thread Tamás Nepusz
> Thank you for explaining this for me. But I am still confused about why > multiply > m at last using Ki/2m * Kj/2m * 2. Because the graph is undirected, so an edge generated from vertex i to vertex j (which has probability Ki/2m * Kj/2m) is equivalent to an edge generated from vertex j to ve

Re: [igraph] Definition of Modularity

2013-02-13 Thread Tamás Nepusz
> Hi, sorry for letting you misunderstand. What I am not sure is that why at > last multiply > > m since I thought Ki/2m * Kj/2m * 2v was the last result. Thanks! You are generating m edges, and each generated edge falls between vertices i and j with probability Ki/2m * Kj/2m * 2. Therefore, the

Re: [igraph] Multilevel vs Label propagation

2013-02-14 Thread Tamás Nepusz
> than the multilevel algorithm but theoretically the LPA is superior since it > is linear. There are at least three catches here: 1) The multilevel algorithm is also claimed to be "near linear" on sparse graphs. We haven't benchmarked it, this is what is written in the publication of the multi

Re: [igraph] igraph installation error on Mac 10.6

2013-02-15 Thread Tamás Nepusz
> #1 > The installer option fails at the Destination Select window with the > statement: > “Python-igraph 0.6 can’t be installed on this disk. python-igraph requires > Apple Python 2.7 to install” > > Python 2.7 is the default version (not sure how to direct the ins

Re: [igraph] how much time does layout.kamada.kawai() need...

2013-02-15 Thread Tamás Nepusz
Hi, I would probably use the DrL layout instead of Kamada-Kawai -- chances are that you would probably get the same hairball with KK as the one that you would get by dropping your points randomly in the unit sphere :) As for KK, I would expect at least a few days of computation time for a graph

Re: [igraph] igraph installation error on Mac 10.6

2013-02-15 Thread Tamás Nepusz
Hi, > Thanks for your help. I did need upgrade to using the python.org installer > (not from source). Is there a way to trick the installer into using this > (e.g., what is the installer looking for to see if this is an apple provided > python). No, there isn't, as far as I know. > I haven't i

Re: [igraph] Error with betweenness() for weighted graph

2013-02-15 Thread Tamás Nepusz
Hi, Thanks for the report, this is indeed a bug. You can subscribe to the following bug report if you are interested in when we will fix it: https://bugs.launchpad.net/igraph/+bug/1126603 -- Tamas On 8 Feb 2013, at 16:29, Manisha wrote: > Hello friends, > > This is the first time I am usin

Re: [igraph] Error with betweenness() for weighted graph

2013-02-15 Thread Tamás Nepusz
Oh, I forgot to mention: the workaround for the time being is to calculate the betweenness score for all the vertices and then extract the value corresponding to "a" from the result vector: scores = g.betweenness(weights="weight") print scores[g.vs.find("a").index] This won't take longer than c

Re: [igraph] igraph installation error on Mac 10.6

2013-02-15 Thread Tamás Nepusz
> My mistake, actually there is (somehow I don't remember trying to install > igraph before) an igraph folder that was in: It seems like Python is not able to find the instance of libigraph.dylib that was used when the Python interface was compiled. Did you also delete /opt/local/lib/libigraph*

Re: [igraph] faster way to add attributes to nodes

2013-02-16 Thread Tamás Nepusz
> I have to attach node attributes which I have stored in a matrix like: > > id posts threads zindex > "u32" "123" "12""0.45" > > is there anything faster than this: Yes, there is. First, construct an index vector where the i-th element denotes the index of the vertex whose

Re: [igraph] Finding reciprocal node pairs in medium/large graphs

2013-02-16 Thread Tamás Nepusz
> How can I get a list (or vector, or df) containing all of the > reciprocal node pairs? See ?is.mutual; e.g.: > el <- get.edgelist(g) > el[is.mutual(g), ] This gives you the subset of the edge list corresponding to mutual edges. If you are interested in the indices of mutual edges, use which(is

Re: [igraph] capturing edge weights in g <- graph.data.frame?

2013-02-16 Thread Tamás Nepusz
> I have a data.frame with two columns, FROM and TO. Each are names of > people where the person in FROM sent a message to the person in TO. > There are many cases where person X sends to Y, but graph.data.frame > doesn't appear to capture edge weight. Are the weights defined explicitly in your dat

Re: [igraph] Error in i.parse.plot.params(graph, list(...)) : Unknown plot parameters: label.color, label.dist

2013-02-20 Thread Tamás Nepusz
Thanks for the heads up; this is probably a typo and Gabor will fix that. In the meanwhile, try vertex.label.color and vertex.label.dist. -- T. On 20 Feb 2013, at 20:54, Kun Deng wrote: > The following snippet in the igraph tutorial won't run: > > > g <- barabasi.game(100, directed=FALSE) >

Re: [igraph] Multilevel vs Label propagation

2013-02-20 Thread Tamás Nepusz
Hi, So I've checked our implementation of community_label_propagation() and it is indeed quadratic, not linear. The reason is that we are using a dense vector to count the number of occurrences of labels in the neighborhood of a node, and clearing this vector takes O(n) time, while it would be

Re: [igraph] Checking whether graph g1 is a subgraph of graph g2

2013-02-22 Thread Tamás Nepusz
Hi, Seems like this is the same question as the one asked recently on Stack Overflow; see my answer there: http://stackoverflow.com/a/15008720/156771 The bottom line is to use the VF2 subisomorphism algorithm in igraph, which handles node and edge colors. You just have to convert your node lab

Re: [igraph] Plotting order of a network

2013-02-22 Thread Tamás Nepusz
Hi Jeff, I don't know whether controlling the order in which nodes are drawn is actually possible in the R interface (maybe Gabor can answer that if he's around). It is true that nodes are drawn in order of their vertex IDs by default and lower IDs are drawn first. One thing that you can surely

Re: [igraph] Need igraph to generate foam networks

2013-02-22 Thread Tamás Nepusz
Hi, > a) Can I constrain the lengths of all the edges to a given value? > b) Can I constrain the orientation of edges such that they look like the real > physical foam ? > (Think of it as constraining the edges such that they form adjacent > structural frames each of which look like a sphere) N

Re: [igraph] igraph-help Digest, Vol 79, Issue 19

2013-02-22 Thread Tamás Nepusz
> I also want to know is there any way to obtain the exponent element of graphs > generated by Barabasi model or not? Yes, there is -- look it up in the paper of Barabasi and Albert ;) In theory, the model generates networks where the degree distribution is a power-law with gamma=3. There is a f

Re: [igraph] Problem using graph.bipartite

2013-02-27 Thread Tamás Nepusz
> Please find the toy data as an attachment to this mail. I haven't found any attachment in your email; did you forget to attach it? Best, Tamas ___ igraph-help mailing list igraph-help@nongnu.org https://lists.nongnu.org/mailman/listinfo/igraph-help

Re: [igraph] multilevel community in weighted networks

2013-02-27 Thread Tamás Nepusz
Hi Stefano, Sorry for the late reply. I'm not sure what happens here, but here's what I think. The modularity function has a so-called "resolution limit" (see http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1765466/ ) which basically prevents one from detecting communities that are smaller than a g

Re: [igraph] Problem using graph.bipartite function

2013-02-28 Thread Tamás Nepusz
Hi, I assume that "C1 C2" is the header of your file and they are not actual nodes. Delete that line and use read.graph(..., format="ncol") to read the file into igraph. This will not create you a bipartite graph yet, only a "simple" graph, but the only thing you need to do in order to make it

Re: [igraph] segmentation fault(core dumped)

2013-03-02 Thread Tamás Nepusz
Hi, Please stay on the list with your follow-up emails. Your code works fine for me (apart from the fact that you did not post your full code so I had to guess the missing parts myself). Some suggestions: 1. igraph_real_t is simply a double, so you can use fscanf directly on your input file wi

Re: [igraph] how to create a graph from an adjacency - like matrix

2013-03-04 Thread Tamás Nepusz
> I have a large numeric matrix in R as follows: > > > dim(libfactor.mat) > [1] 4052310 > > head(libfactor.mat) > [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] > [1,] 20884 19184 19185 NA NA NA NA NA NANA > [2,] 18330 13979 13978 NA NA NA NA NA NANA

Re: [igraph] closeness and average path length in terms of the harmonic distance between vertices

2013-03-07 Thread Tamás Nepusz
Hi Bob, > Sorry I only come back to you only now. shortest.paths does not seem to > indicate the vertices that have been traversed in the shortest paths - just a > matrix of those shortest paths. Yup, but you can use get.shortest.paths() to get _one_ shortest path per vertex pair, or get.all.s

Re: [igraph] Install to virtualenv on OSX 10.8 failing

2013-03-07 Thread Tamás Nepusz
Hi Adam, Things are in a transition period right now; we have released igraph 0.6.5 and the corresponding Python interface a few days ago, but Homebrew still installs igraph 0.6 because I haven't had time to update the recipe yet. Try the following: easy_install python-igraph==0.6 This will f

Re: [igraph] Install to virtualenv on OSX 10.8 failing

2013-03-07 Thread Tamás Nepusz
Hi Adam, FYI, I have filed a pull request to the Homebrew project to upgrade the igraph formula to 0.6.5: https://github.com/mxcl/homebrew/pull/18313 If you don't want to wait until the changes are merged, type "brew edit igraph" and replace the red lines with the green ones as seen on the fol

Re: [igraph] Python - indexing Graph object using pair of vertex indices doesn't work

2013-03-10 Thread Tamás Nepusz
Hi! > Is this a bug or is something wrong? I'm using Python 2.7.3 on Ubuntu Linux > 12.10 64-bit. I've installed igraph from the standard package repository. What is the version number of the igraph module in Python? If igraph.__version__ is less than 0.6, this means that you don't have this fe

Re: [igraph] Doubt betweenness {igraph}

2013-03-11 Thread Tamás Nepusz
> I am graduating from PUC Minas Brazil and my work theme of completion is on > the R language, specifically on the package IGRAPH. I wonder if you can help > me understand how R calculates the centrality of edges in the function below: The calculation is not implemented in R; it is implemented i

  1   2   3   4   5   6   7   >