=3B
I'm an engeener-student at a high school=2C

I' m looking for how =3Bto apply Fordfullkerson's algorithm in R so= ftware=2C by using graph theory=2C

I try the "igraph" packges =2C especially the graph.maxflow function=2C= but there is no example for it in the documentation=2C
=3B
after asking the professor Gabor Csardi=2C I found how to apply the functio= n=2C but it give me just the the value of the maximum
flow(wich is important..) but not the flows =3Bat the =3Bedges=2C I= don't know how the extract all results of the function..
=3B
OR: is there an other function wich do the same thing: solving =3B ford= -Fullkerson algorithm (searching the maximum flow) =3B?

cord= ialement=2C
=3B

Mouhcine Bekkari
=E9l=E8ve-ing=E9nieur G= =E9nie Industriel et Logistique=2C ENSA
Licence professionnelle G=E9nie = Logistique=2C FSSM
acteur associati= f
+212 6 77 66 38 53
mohcinbekkari@hotmail.com
Marrakech=2C Maroc

<= BR>

=3B
>=3B Date: Fri=2C 2 Apr 2010 13:49:27 +0100
>= =3B Subject: Re: can you help me? graph.maxflow : assignment of edge capaci= ty
>=3B From: csardi@rmki.kfki.hu
>=3B To: mohcinbekkari@hotmail.= com
>=3B
>=3B Hello Mouhcine Bekkari=2C
>=3B
>=3B ple= ase send these kind of emails to the igraph-help mailing list=2C see
>= =3B http://igraph.sf.net for details. Thanks.
>=3B
>=3B igraph h= as no implementation of the Ford-Fulkerson algorithm=2C only the
>=3B = push-relabel algorithm is implemented. If that is also good=2C then see
= >=3B the documentation on how to add weights to the edges. Perhaps you wa= nt
>=3B to read the following manual pages:
>=3B
>=3B ?grap= h.data.frame
>=3B ?E
>=3B ?graph.maxflow
>=3B
>=3B Bes= t Regards=2C
>=3B Gabor
>=3B
>=3B On Thu=2C Apr 1=2C 2010 a= t 1:55 PM=2C Mouhcine bekkari
>=3B <=3Bmohcinbekkari@hotmail.com>= =3B wrote:
>=3B >=3B hello Professor Gabor Csardi =2C
>=3B >= =3B
>=3B >=3B I'm an engeener-student at high school=2C
>=3B &g= t=3B I' m looking for how =3Bto apply Fordfullkerson's algorithm in R s= oftware=2C by
>=3B >=3B using graph theory=2C
>=3B >=3B
&g= t=3B >=3B I try the "igraph" packges (I think it's yours)=2C especially t= he
>=3B >=3B graph.maxflow function=2C but there is no example for i= t=2C
>=3B >=3B
>=3B >=3B
>=3B >=3B can you help me? ca= n you give me an example to apply it succefully?
>=3B >=3B
>=3B= >=3B
>=3B >=3B thanks a lot=2C
>=3B >=3B
>=3B >=3B = cordially=2C
>=3B >=3B
>=3B >=3B
>=3B >=3B Mouhcine Be= kkari
>=3B >=3B =E9l=E8ve-ing=E9nieur G=E9nie Industriel et Logistiq= ue=2C ENSA
>=3B >=3B Licence professionnelle G=E9nie Logistique=2C F= SSM
>=3B >=3B mohcinbekkari@hotmail.com
>=3B >=3B
>=3B &= gt=3B
>=3B >=3B
>=3B >=3B
>=3B >=3B
>=3B >=3B _= _______________________________
>=3B >=3B Votre messagerie et bien p= lus o=F9 que vous soyez. Passez =E0 Windows Live
>=3B >=3B Hotmail= =2C c'est gratuit ! Inscrivez-vous
>=3B
>=3B
>=3B
>= =3B --
>=3B Gabor Csardi <=3BGabor.Csardi@unil.ch>=3B UNIL DGM

Hello

I am tryin= g to plot a graph created from the igraph package using the following code:

plot(g7,ve= rtex.size=3D10,edge.arrow.size=3D0.25,layout=3DL,main=3D"7 Day PLD")

but receiv= e the following error message:

Error in p= lot.igraph(g7, vertex.size =3D 10, edge.arrow.size =3D 0.25, layout =3D L,  : subscri= pt out of bounds

All other functions work on this graph and I have used exactly the same arguments to = plot a different graph with the same dimensions and attributes so I am not sure = what is going on. Any help much appreciated.

= Th= anks

= Sa= lly

<= span style=3D'font-size:12.0pt;color:navy'>

Sally Keith  B.Sc, M.Sc.

Research Student

Centre for Conservation Ecology & Environmental Change<= /p>

B= ournemouth University, = UK

E= -mail: skei= th@bournemouth.ac.uk

<= /P>

BU - the UK's Number One = New University

The Guardian University Guide 200= 9 & 2010

<= FONT COLOR=3D"#000000" FACE=3D"Arial" SIZE=3D"2">This email is intended onl= y for the person to whom it is addressed and may contain confidential infor= mation. If you have received this email in error, please notify the sender = and delete this email, which must not be copied, distributed or disclosed t= o any other person.

Any views or opinions presented are solely those o= f the author and do not necessarily represent those of Bournemouth Universi= ty or its subsidiary companies. Nor can any contract be formed on behalf of= the University or its subsidiary companies via email.

Dear colleagues,
=A0
I'm working with igraph-python for a few days, and it's really= a good tool.
But when I turn to dynamic network, I'm puzzled about = how to add some node attributes to the network.
How to save the info of = attributes? how to access the attributes? how to change them?=A0 Can I mani= pulate the node by node's attribute?
I found it mentioned in C-interface (http://igraph.sourceforge.net/doc/html/ch09s02.ht= ml), but I'm confused how to carry it out in python interface.

Could anyone provide some suggestions on that?
Thanks!

Weijia=

Hi

I am running = R2.10 and the latest version of = igrahp on a Windows 7 = 64-machine.

I have a R-Script that runs fine in the GUI of R, but = if I run it with rscript.exe in a = dos-window I get an error:

Error in graph.adjacencyy(djm, weighted =3D TRUE, = mode=3D”directed”):

Could not find = function “is”

(original in = German  konnte Funktion “is” nicht = finden)

Any idea what could cause this problem?

Thanks

Renger

Hi, How I save a graph in svg=20 file?

I've got a 3 columns data frame appearing like this :<= br>
> swap[1= :4,]
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= V3=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 V4=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 V5
1=A0 ff8aa9e5295d5fbeb391e70865f88= 8ba=A0 7ddc60ba3dea9813aec037279dd81c5d=A0 2010-02-19 14:40:29
2=A0 b880733653704653d2= a8329bb9507447=A0 5cb1a800193e064ba95536d6a5018b91=A0 2010-02-19 14:40:35
3=A0 1bace89087a54bb01a093621fc374026=A0 d1= c16d22f59bfec0951d13692dc4c77e=A0 2010-02-19 14:40:36
4=A0 c8873ed38a44311388= e6870a4dfd55d6=A0 eb212222de32bfc2d2d51f01f2b20848=A0 2010-02-19 14:40:43

with V3 source nodes, V4 target nodes and V5 a time stam= p I need as an attribute. When importing it to create a graph I get this me= ssage error :

> graph.data.frame(as.matrix(swap),directed=3DTRUE) ->= g1.sw

Erreur dans attrs[[names(d)[i]]= ] <- newval :
=A0 tentative de s=E9le= ctionner moins d'un =E9l=E9ment

(transl. "you = tried to select less than one element").

Thank you very much !

Yannick

<= br>
---------------------------------------------------------------
Y= annick Rochat - IMA - Universit=E9 de Lausanne
http://www.unil.ch/unisciences/YannickRocha= t
Hi, I use the = following=20 code:

outFolder =3D=20 self.mainView.outputFolderText.GetLabelText()

fileName =3D outFolder+os.sep+"GRAPH_"+self.fileName+".svg"

soglia =3D = int(self.mainView.thresholdText.GetValue())

graph.es["edge_color"]=3D[["red", "black"][value>soglia] = for=20 value in graph.es["iFlow"]]

for vertex in = graph.vs:

vertex["vertex_color"] =3D = "green"

visualStyle =3D {}

visualStyle["margin"] =3D = 20

visualStyle["edge_color"] = =3D=20 [["red", "black"][value>soglia] for value in=20 graph.es["iFlow"]]

visualStyle["vertex_color"] =3D=20 "green"

but when I open svg file I can = see that my=20 visualStyle are not applied to my graph. Why?

I am using igraph_path_length_hist() to get the path= length histogram. It always shows "segment default".=A0
My code looks likes as follows:
=A0=A0 =A0
=A0= =A0 =A0 =A0igraph_vector_init(&hist_path, 0);
=A0=A0 =A0 igraph_path_length_hist(&graph, &hist_path, NULL, 0= ); =A0 =A0
=A0=A0 =A0 size =3D igraph_vector_size(&hist_path)= ;
=A0=A0 =A0 printf("size is:%d\n", (int)size);
=A0=A0 =A0 int i;
=A0=A0 =A0 for (i=3D0; i<size; i++)
=A0=A0 =A0 =A0 printf= ("hist length: %d\n", (int)VECTOR(hist_path)[i]);

<= /div>
I do not know where is wrong. Another question is about path leng= th hist. Is it the path length distribution. That is, the number of paths w= ith length 1, 2,...=A0

--
Thanks
=A0

O= n Tue, Apr 13, 2010 at 1:41 PM, Tamas Nepusz wrote:
> I am using igraph_pa= th_length_hist() to get the path length histogram. It always shows "se= gment default".
You cannot pass NULL as the third argument of igraph_path_length_hist= as this is the place where the number of unconnected vertex pairs will be = returned. So the solution is:

igraph_real_t unconn;
igraph_vector_init(&hist_path, 0);
igraph_path_length_hist(&graph, &hist_path, &unconn, 0);<= br>
--
T.

_______________________________________________
igraph-help mailing list
igraph-help@nongnu.org
http://lists.nongnu.org/mailman/listinfo/igraph-help

--
Thanks
zhengjun
Dept of Computer Science and Engineering<= br>Lehigh University

How I can make of vector of vectors (igraph_ve= ctor_t) using igraph C library.=A0

Mile Sikic

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Apologies for asking a q= uestion which has already been asked before. Is there any way of finding al= l the paths(not just the shortest paths) between all pairs of nodes of a ne= twork "programmatically"(i.e. not by using any in-built function = of igraph) in R/igraph. Thanks in advance for any suggestions.

Regards,

Anupam Sinha

--
Center For DNA Fingerprinting And Diagnostics,
4-1-714 to 725/2, = Tuljaguda complex
thank you.=A0

Mile

On Wed, Apr 14, 2010 at= 12:34 AM, Tamas Nepusz wrote:
> How I can make of ve= ctor of vectors (igraph_vector_t) using igraph C library.
igraph_vector_ptr_t can be used to store pointers to igraph_vector_t = objects -- in fact, this is what we use it for the most frequently in the C= core :)

http://igraph.sourceforge.net/doc/html/ch06s02s14.html

--
Tamas

_______________________________________________
igraph-help mailing list
igraph-help@nongnu.org
http://lists.nongnu.org/mailman/listinfo/igraph-help

Mile

On Wed, Apr 14, 2010 at 9:35 AM, Tamas Nepusz <ntamas@gmail.com> wrote:
> Could you give me an= example how I can make vector of 100 igraph_vector_t objects and how I sho= uld handle memory
> thank you.
Well, if you only need 100 vectors (in other words, if the number of = igraph_vector_t objects you need is fixed), you don't really need an ig= raph_vector_ptr_t for that, you can simply allocate 100 igraph_vector_t obj= ects using calloc:

igraph_vector_t* vectors;
vectors =3D (igraph_vector_t*)calloc(100, sizeof(igraph_vector_t));
for (i =3D 0; i < 100; i++) {
=A0igraph_vector_init(vectors + i);
}
[...do whatever you want with your vectors...]
for (i =3D 0; i < 100; i++) {
=A0igraph_vector_destroy(vectors + i);
}
free(vectors);

Code untested, but shows the general idea.

--
Tamas

_______________________________________________
igraph-help mailing list
igraph-help@nongnu.org
http://lists.nongnu.org/mailman/listinfo/igraph-help

Hi all,
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Thanks a lot for you= r suggestions.

Regards,

Anupam

I am an assistant on a research project in Canada. We are trying to solve an issue with social network analysis. Our main concern is how to proceed to place dots in the matrix? How can we place all dots on our social network graph? If you can answer me in terms of programming, it would really help us. Presently, we only manage to place them in circle but we know it's not the best way to represent our social network.

Thank you very much,

Vincent Gagnon
University of Quebec in Chicoutimi

http://igraph.sourceforge.net/screenshots.html

it was not at all clear for me that you want to= use another tool than igraph. The thing is, this mailing list is about igr= aph issues.=A0

If you want to implement things in = Java, that is fine, see the references to the algorithms in the igraph manu= al, you can read those and write your implementation. Alternatively, you ca= n search for open source code in network visualization packages that are wr= itten in Java, e.g. Cytoscape. You can even try google codesearch to find a= free implementation.=A0

Best,
Gabor

On Wed, Apr 21, 2010 at 6:50 AM, Vincent Gagnon wrote= :
=20
Hello Gabor,

I've been reading through http://igraph.sourceforg= e.net/igraphbook/igraphbook-creating.html
If I am correct, I understand that this page explains how to prepare your data to go through iGraph software? Is that correct?

Our problem is that we cannot use iGraph, even if we believe it would be the perfect solution. We must use a unique programmation language using Java that was designed in Toronto to work with Knowledge Forum. http://www.knowledg= eforum.com/ = http://en.wikipedia.org/wiki/Knowledge_Forum

Knowledge Forum is a software designed for school purpose and it integrates Java Assessment Applets which are programmed with Java especially for KF.(Knowledge Forum) There are actually different applets, Contribution Tool, the Semantic Overlap Tool, the Vocabulary Growth Tool, the Writing Measures Tool and the Social Network Tool. (http://ikit.org/kf/46/help/enhanced/NetworkAnalysisTool.htm)
Actually, the social network tool is limited. If you look closely at the last link I inserted above, you'll see that the representation layout it generates are unclear. (I also included it below) We presently have one programmer that is familiar with programming in Java, and he has access to the code of the program. We would like to help him introduce other algorithms that makes it possible to display social network with a pattern like iGraph can display. Layout like Fruchterman-Reingold, tkplot or Erdos-R=E9nyi random graph are what we are aiming.

I also want to inform you that we are not business oriented, we are a group of searchers developing these tools for teachers who use Knowledge Forum and who expect to better understand the social network patterns developing between their students using this tool. I also want you to know that Knowledge Forum is expected to open its code to public. We believe in sharing work, and this projet is taking this next step in the near future.

I hope I have been clearer in explaining the context surrounding my request for some help,

Sincerely,

Vincent Gagnon
University of Quebec in Chicoutimi

Le 2010-04-20 15:59, G=E1bor Cs=E1rdi a =E9crit=A0:
```Hi Vincent,

igraphbook-creating.html
after reading an R tutorial. See the R homepage for tutorials.

Gabor

On Tue, Apr 20, 2010 at 9:43 PM, Vincent Gagnon <vincent.gagnon@uqac.ca> wrote:
```
```Hi Gabor,

I now understand what you meant by R and Python, those are two languages of
programmation for SNA. Is that correct? I know I'm a newbie in SNA. I h=
ave
looked at your attached links and I've seen that among all possible SNA
representation, the way to generate coordinate are the followings:

layout.random(graph, params, dim=3D2)
layout.circle(graph, params)
layout.sphere(graph, params)
layout.fruchterman.reingold(graph, ..., dim=3D2,
verbose=3Digraph.par("verbose"), params)

verbose=3Digraph.par("verbose"), params)
layout.spring(graph, ..., params)
layout.reingold.tilford(graph, ..., params)
layout.fruchterman.reingold.grid(graph, ...,
verbose=3Digraph.par("verbose"), params)

layout.lgl(graph, ..., params)
layout.graphopt(graph, ..., verbose =3D igraph.par("verbose"), pa=
rams =3D
list())
layout.mds(graph, d=3Dshortest.paths(graph), ...)
layout.svd(graph, d=3Dshortest.paths(graph), ...)

layout.norm(layout, xmin =3D NULL, xmax =3D NULL, ymin =3D NULL, ymax =3D N=
ULL,
zmin =3D NULL, zmax =3D NULL)

We are looking for a way to calculate the data positionning. We don't k=
now
how to proceed with calculation, but from your database information, I thin=
k
it will be something like "layout.fruchterman.reingold" or anothe=
r function.

For you information, I've attached a picture of our actual SNA displays=
. We
can generate circle representations and some random placing nodes. We would
like to succeed in placing them in a Fruchterman Reingold display.

Can you help us programming the algorithm? Or, how do we calculte nodes
positionning?

Vincent Gagnon
University of Quebec in Chicoutimi

2010/4/20 G=E1bor Cs=E1rdi <csardi@rmki.kfki.hu>
```
```Hi Vincent,

You have a long way to go to work with igraph if you do not know R or
Python. Here is where to start:

http://www.r-project=
.org
http://www.python.org

Gabor

On Tue, Apr 20, 2010 at 9:04 PM, Vincent Gagnon <vincent.gagnon@uqac.ca>
wrote:
```
```Hi Gabor,

2010/4/20 G=E1bor Cs=E1rdi <csardi@rmki.kfki.hu>
```
```Hi Vicent,

On Tue, Apr 20, 2010 at 8:44 PM, Vincent Gagnon
<vincent.gag=
non@uqac.ca>
wrote:
```
```Hello igraph-help members,

I am an assistant on a research project in Canada. We are trying to
solve an
issue with social network analysis. Our main concern is how to
proceed
to
place dots in the matrix?
```
```what exactly do you mean by this?

You need a way to smartly place the
nodes for drawing the graph?
```
```Yes, I need to understand how to have a smart way to place nod=
es in the
graph.
```
```You did not tell us whether you want to
```
```I don't know the difference between R and Pythin. Can you =
show me or
explain
me?
```
```use R or Python. In R this would be something like:

pos <- layout.fruchterman.reingold(mygraph)
plot(mygraph, layout=3Dpos)

Check the documentation for the various plot options at
http://igraph.sourceforge.net/doc/R/layout.html or type

http://igraph.sourceforge.net/doc/R/plot.common.html or type

help("igraph.plotting")

Gabor
```
```Thank you Gabor!
```
`          `
```How can we place all dots on our social network
graph? If you can answer me in terms of programming, it would really
help
us. Presently, we only manage to place them in circle but we know
it's
not
the best way to represent our social network.

Thank you very much,

Vincent Gagnon
University of Quebec in Chicoutimi

http://igraph.sourceforge.net/screenshots.html

_______________________________________________
igraph-help mailing list
igraph-help@non=
gnu.org
http://lists.nongnu.org/mailman/listinfo/igraph-help

```
```--
Gabor Csardi <=
Gabor.Csardi@unil.ch> =A0 =A0 UNIL DGM
```
`        `
```--
Gabor Csardi <=
Gabor.Csardi@unil.ch> =A0 =A0 UNIL DGM
```
`    `
`  `

```--=20
Vincent Gagnon
Maitrise en =E9ducation
Universit=E9 du Qu=E9bec =E0 Chicoutimi

(418) 698-7134 Maison
(418) 550-1881 Cellulaire```

--
Gabor Csardi <Gabor.Csardi@unil.ch> =A0 =A0 UNIL= DGM

Sorry to bring this up again. I thought that I understoo= d your response last month, but I'm trying to interpret my results, and= I want to make sure.

When you said that the spinglass code normaliz= es by the number of edges, do you mean -- focusing on the "sum(Aij - k= i*kj/2m)" term of modularity --=A0 1) that Aij is the weight of the ed= ge but ki and kj are just the degrees of the nodes? Or 2) is the degree of = ki also multiplied by the average weight of the graph? (This as opposed to = ki being the sum of the weights of the adjacent edges, as for the modularit= y code.)

I=A0 am pretty sure you meant (2), which I think upholds the relationsh= ip Q_spinglass =3D -H/M where H is the Hamiltonian the code is trying to mi= nimize and M is the number of edges. Because the null model in the Hamilton= ian for weighted graphs in that paper replaced every edge's weight with= the mean weight of the graph. Basically I think that for my purposes I may= want to use the modularity value output by the spinglass.algorithm, with t= he understanding that it has a different meaning than Newman-type modularit= y for weighted graphs. But I want to make sure I'm not confused here.
Thanks,
Aaron

On Tue, Mar = 16, 2010 at 2:09 PM, G=E1bor Cs=E1rdi wrote:
OK, the explanation is pretty simple. In the unweighted case, one has
to give explicitly

sc2 <- spinglass.community(g, weights=3Drep(1, ecount(g)))

otherwise the weights will be used. If one does that, then the two
modularity values are the same.

In the weighted case, the spinglass code normalizes by the number of
edges and the modularity function normalizes by the sum of the
weights, hence the difference.

I'll modify the spinglass code, to normalize by the sum of the
weights. I think this is a better approach.

Actually, the spinglass code always reports the Newman-type
modularity, not the generalized quantity. Maybe this should be updated
as well. Together with the spinglass.community() interface, to be
consistent with other functions that have a 'weights' argument.

Thanks again for the report!

Best Regards,
Gabor

On Mon, Mar 15, 2010 at 5:29 PM, Aaron Alexander-Bloch
<aalexanderbloch@gmail.com> wrote:
> Thank you both,
> I'm eager to hear what you find Gabor.
> Best,
> Aaron
>
> On Fri, Mar 5, 2010 at 11:32 PM, G=E1bor Cs=E1rdi <csardi@rmki.kfki.hu> wrote:
>>
>> Hi Aaron,
>>
>> hmmm, you are right, something strange is going on here, if I run = the
>> following:
>>
>> R
>>
>> library(igraph)
>>
>> largest.component <- function(x) {
>> =A0cl <- clusters(x)
>> =A0ss <- which(cl\$membership =3D=3D which.max(cl\$csize)-1)-1 >> =A0subgraph(x, ss)
>> }
>>
>> g <- largest.component(erdos.renyi.game(100, p=3D5/100))
>> E(g)\$weight <- runif(ecount(g))
>> sc <- spinglass.community(g, weights=3DE(g)\$weight)
>> sc\$modularity
>> modularity(g, sc\$membership, weights=3DE(g)\$weight)
>>
>> sc2 <- spinglass.community(g)
>> sc2\$modularity
>> modularity(g, sc2\$membership)
>>
>> # I get
>>
>> > sc\$modularity
>>  0.2808567
>> > modularity(g, sc\$membership, weights=3DE(g)\$weight)
>>  0.4861468
>> >
>> > sc2 <- spinglass.community(g)
>> > sc2\$modularity
>>  0.2737963
>> > modularity(g, sc2\$membership)
>>  0.3635749
>>
>> which is clearly different, both in the weighted and unweighted ca= se.
>> For spinglass.community we just use the modularity value calculate= d by
>> the community detection code, as implemented by the original autho= r of
>> the algorithm.
>>
>> I will check why the two values are not the same. Thanks for your = report!
>>
>> Best,
>> Gabor
>>
>> On Tue, Mar 2, 2010 at 9:05 PM, Aaron Alexander-Bloch
>> <aalexanderbloch@g= mail.com> wrote:
>> > Hi - Thanks in advance for any help.
>> >
>> > I'm trying to apply spinglass.community in the R package = to dense
>> > weighted
>> > networks and have some trouble interpreting the modularity va= lue in my
>> > results. I'm assuming that \$modularity is the value of th= e Hamiltonian
>> > as in
>> > the Reichardt/Bornholdt paper. As I'm keeping the gamma p= arameter at 1
>> > and
>> > using the 'config' model, my understanding is that th= e Hamiltonian is
>> > the
>> > same as Newman's modularity, at least for binary graphs. = But I'm not
>> > clear
>> > on how these concepts are related for weighted graphs. If I s= eparately
>> > get
>> > the modularity value of the partition that spinglass gives me= , it is
>> > different from the modularity value given by spinglass direct= ly. So my
>> > question is how should the modularity value given by spinglas= s be
>> > interpreted for weighted graphs?
>> >
>> > In a related question, is there any plan to implement the &qu= ot;weighted
>> > version"
>> > of this method as in Heimo (2008)
>> >
>> > http://iopscience.iop.org/1742-5468/2008/08/P08007/
>> >
>> > Thanks very much!
>> > Aaron
>> >
>> > _______________________________________________
>> > igraph-help mailing list
>> >
igraph-help@nongnu.= org
>> > http://lists.nongnu.org/mailman/listinfo/igraph-help<= /a>
>> >
>> >
>>
>>
>>
>> --
>> Gabor Csardi <
Gabor.Csa= rdi@unil.ch> =A0 =A0 UNIL DGM
>>
>>
>> _______________________________________________
>> igraph-help mailing list
>> igraph-help@nongnu.org
>>
http://lists.nongnu.org/mailman/listinfo/igraph-help >
> _______________________________________________
> igraph-help mailing list
> igraph-help@nongnu.org > http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>

--
Gabor Csardi <Gabor.Csardi@unil.= ch> =A0 =A0 UNIL DGM

_______________________________________________
igraph-help mailing list
igraph-help@nongnu.org
http://lists.nongnu.org/mailman/listinfo/igraph-help

It seems like the difference between

modularity(graph, spinglass(graph)\$community, weights =3D E(graph)\$weight)<= br>
and

spinglass(graph)\$modularity

is that in spinglass() the m term in modularity is taken to be the number o= f edges as opposed to the sum of the weights, even though Aij, ki, and kj are as for modularity(). This has nothing at all to do with the function that's actually optimized in the spinglass code to get the par= tition. It's another null model entirely, which you plan to change.

Is this correct? Really this was pretty clear from your original response; I just didn't understand for some reason. Please do correct me if this wrong.

Thanks again,
Aaron

On Thu, Apr 22, 2010 at 7:37 PM, Aa= ron Alexander-Bloch wrote:
Dear Gabor,

Sorry to bring this up again. I thought that I understoo= d your response last month, but I'm trying to interpret my results, and= I want to make sure.

When you said that the spinglass code normaliz= es by the number of edges, do you mean -- focusing on the "sum(Aij - k= i*kj/2m)" term of modularity --=A0 1) that Aij is the weight of the ed= ge but ki and kj are just the degrees of the nodes? Or 2) is the degree of = ki also multiplied by the average weight of the graph? (This as opposed to = ki being the sum of the weights of the adjacent edges, as for the modularit= y code.)

I=A0 am pretty sure you meant (2), which I think upholds the relationsh= ip Q_spinglass =3D -H/M where H is the Hamiltonian the code is trying to mi= nimize and M is the number of edges. Because the null model in the Hamilton= ian for weighted graphs in that paper replaced every edge's weight with= the mean weight of the graph. Basically I think that for my purposes I may= want to use the modularity value output by the spinglass.algorithm, with t= he understanding that it has a different meaning than Newman-type modularit= y for weighted graphs. But I want to make sure I'm not confused here.
Thanks,
Aaron

On Tue, Mar 16, 2010 a= t 2:09 PM, G=E1bor Cs=E1rdi wrote:
OK, the explanation is pretty simple. In the unweighted case, one has
to give explicitly

sc2 <- spinglass.community(g, weights=3Drep(1, ecount(g)))

otherwise the weights will be used. If one does that, then the two
modularity values are the same.

In the weighted case, the spinglass code normalizes by the number of
edges and the modularity function normalizes by the sum of the
weights, hence the difference.

I'll modify the spinglass code, to normalize by the sum of the
weights. I think this is a better approach.

Actually, the spinglass code always reports the Newman-type
modularity, not the generalized quantity. Maybe this should be updated
as well. Together with the spinglass.community() interface, to be
consistent with other functions that have a 'weights' argument.

Thanks again for the report!

Best Regards,
Gabor

On Mon, Mar 15, 2010 at 5:29 PM, Aaron Alexander-Bloch
<aalexanderbloch@gmail.com> wrote:
> Thank you both,
> I'm eager to hear what you find Gabor.
> Best,
> Aaron
>
> On Fri, Mar 5, 2010 at 11:32 PM, G=E1bor Cs=E1rdi <csardi@rmki.kfki.hu> wrote:=
>>
>> Hi Aaron,
>>
>> hmmm, you are right, something strange is going on here, if I run = the
>> following:
>>
>> R
>>
>> library(igraph)
>>
>> largest.component <- function(x) {
>> =A0cl <- clusters(x)
>> =A0ss <- which(cl\$membership =3D=3D which.max(cl\$csize)-1)-1 >> =A0subgraph(x, ss)
>> }
>>
>> g <- largest.component(erdos.renyi.game(100, p=3D5/100))
>> E(g)\$weight <- runif(ecount(g))
>> sc <- spinglass.community(g, weights=3DE(g)\$weight)
>> sc\$modularity
>> modularity(g, sc\$membership, weights=3DE(g)\$weight)
>>
>> sc2 <- spinglass.community(g)
>> sc2\$modularity
>> modularity(g, sc2\$membership)
>>
>> # I get
>>
>> > sc\$modularity
>>  0.2808567
>> > modularity(g, sc\$membership, weights=3DE(g)\$weight)
>>  0.4861468
>> >
>> > sc2 <- spinglass.community(g)
>> > sc2\$modularity
>>  0.2737963
>> > modularity(g, sc2\$membership)
>>  0.3635749
>>
>> which is clearly different, both in the weighted and unweighted ca= se.
>> For spinglass.community we just use the modularity value calculate= d by
>> the community detection code, as implemented by the original autho= r of
>> the algorithm.
>>
>> I will check why the two values are not the same. Thanks for your = report!
>>
>> Best,
>> Gabor
>>
>> On Tue, Mar 2, 2010 at 9:05 PM, Aaron Alexander-Bloch
>> <aalexanderbloch@gmail.com> wrote:
>> > Hi - Thanks in advance for any help.
>> >
>> > I'm trying to apply spinglass.community in the R package = to dense
>> > weighted
>> > networks and have some trouble interpreting the modularity va= lue in my
>> > results. I'm assuming that \$modularity is the value of th= e Hamiltonian
>> > as in
>> > the Reichardt/Bornholdt paper. As I'm keeping the gamma p= arameter at 1
>> > and
>> > using the 'config' model, my understanding is that th= e Hamiltonian is
>> > the
>> > same as Newman's modularity, at least for binary graphs. = But I'm not
>> > clear
>> > on how these concepts are related for weighted graphs. If I s= eparately
>> > get
>> > the modularity value of the partition that spinglass gives me= , it is
>> > different from the modularity value given by spinglass direct= ly. So my
>> > question is how should the modularity value given by spinglas= s be
>> > interpreted for weighted graphs?
>> >
>> > In a related question, is there any plan to implement the &qu= ot;weighted
>> > version"
>> > of this method as in Heimo (2008)
>> >
>> > http://iopscience.iop.org/1742-5468/2008/08/P08007/
>> >
>> > Thanks very much!
>> > Aaron
>> >
>> > _______________________________________________
>> > igraph-help mailing list
>> >
i= graph-help@nongnu.org
>> > http://lists.nongnu.org/mailman/listinfo/igraph-help<= /a>
>> >
>> >
>>
>>
>>
>> --
>> Gabor Csardi <
Gabor.Csardi@unil.ch> =A0 =A0 UNIL DGM
>>
>>
>> _______________________________________________
>> igraph-help mailing list
>> igraph= -help@nongnu.org
>> http://lists.nongnu.org/mailman/listinfo/igraph-help >
> _______________________________________________
> igraph-help mailing list
> igraph-hel= p@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>

--
Gabor Csardi <= Gabor.Csardi@unil.ch> =A0 =A0 UNIL DGM

_______________________________________________
igraph-help mailing list
igraph-help@non= gnu.org
http://lists.nongnu.org/mailman/listinfo/igraph-help

FYI, in the latest versions of GCC, one can use the flag
=A0-march=3Dnative
which supersedes
=A0-march=3DyourCPU-type -mtune=3DyourCPU-type

Cheers,

Olivier

=A3ukasz R=EAc=B3awowicz wrote:
```2010/4/28, G=E1bor Cs=E1rdi <csardi@rmki.kfki.hu>:

```
```As I have told you already, it is much easier to use t=
he windows
package building service, at http://win-builder.r-project.org/
```
```
Indeed :)

And here are GCC speed-up flags in PKG_CPPFLAGS
-O3 -fomit-frame-pointer -march=3DyourCPU-type -mtune=3DyourCPU-type -fip=
a-pta

yourCPU-type can be found on gcc.gnu.org in : i386 and x86-64 Windows Opt=
ions
(core2, nocona, pentium2, k6, and so on)

This give me ~40% cpu time less for betweenness.
```
Gabor, = Tamas--

My next issue is that calculating = betweenness (or even betweenness.estimate) is taking a very long time = for my large graph. I took what I thought to be the simplest, fastest = case, and nothing seems to be = happening:

> = summary(g)
Vertices: 17584663
Edges: = 27831117
Directed: TRUE
No graph = attributes.
No vertex attributes.
Edge attributes: = weight.

> system.time(bw <- = betweenness.estimate(g, cutoff=3D1, verbose=3DTRUE))
Betweenness= centrali: = *-------------------------------------------------|
+ =  Stopped                 = R
Timing stopped at: 1720.275 5.374 = 1785.619

As you can see I chose the cutoff=3D1, = which is not a result I am interested in, but having experience similar = long waits with cutoff=3D5 and cutoff=3D3, I decided to try what should = be the fastest run. So the progress meter showed no movement in a = half-hour, while the processor was maxed at 100% and no change at all in = memory footprint:

top - 02:12:12 up =  1:07,  3 users,  load average: 0.99, 0.97, = 0.89
Tasks:  56 total,   3 running,  53 = sleeping,   0 stopped,   0 zombie
Cpu(s): 50.0%us, =  0.0%sy,  0.0%ni, 50.0%id,  0.0%wa,  0.0%hi, =  0.0%si,  0.0%st
Mem:   7872420k total, =  6496400k used,  1376020k free,    47304k = buffers
Swap:        0k total,   =      0k used,        0k free, =  1471244k cached

PID USER =      PR  NI  VIRT  RES  SHR S %CPU = %MEM    TIME+  COMMAND           =                     =                     =                 =
21396 root      25   0 4779m = 4.5g 3260 R  100 60.0  22:25.66 R   =                 =                     =                     =                 =
1 root      15   = 0 10300  800  672 S    0  0.0   0:00.02 = init                   =                     =                     =             =
2 root      RT =   0     0    0    0 S    0 =  0.0   0:00.00 migration/0           =                     =                     =               =
3 root      34 =  19     0    0    0 S    0 =  0.0   0:00.00 ksoftirqd/0           =                     =                     =               =
4 root      RT   = 0     0    0    0 S    0 =  0.0   0:00.00 watchdog/0       =

[root@ip-10-194-207-95 dave]# sar = -r 1 10
Linux 2.6.21.7-2.ec2.v1.2.fc8xen = (ip-10-194-207-95)  = 04/30/10

02:13:20    kbmemfree = kbmemused  %memused kbbuffers  kbcached kbswpfree kbswpused =  %swpused  kbswpcad
02:13:21     =  1376004   6496416     82.52   =   47400   1471244         0     =     0      0.00         = 0
02:13:22      1376004   6496416   =   82.52     47400   1471244       =   0         0      0.00   =       0
02:13:23      1376004 =   6496416     82.52     47400   1471244 =         0         0   =    0.00         0
02:13:24 =      1376004   6496416     82.52   =   47400   1471244         0     =     0      0.00         = 0
02:13:25      1376004   6496416   =   82.52     47400   1471244       =   0         0      0.00   =       0
02:13:26      1376004 =   6496416     82.52     47408   1471236 =         0         0   =    0.00         = 0

I've read that = even in 64-bit R implementations some memory structures are limited to = 2GB. Are there any structures in igraph that are so limited? My graph = appears to be taking up ~5GB of space in = memory.

Any ideas?

David Hunkins

=

= --Apple-Mail-44-97503425-- From MAILER-DAEMON Fri Apr 30 04:20:37 2010 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1O7lSf-0007d6-Ic for mharc-igraph-help@gnu.org; Fri, 30 Apr 2010 04:20:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O7lSd-0007cR-JY for igraph-help@nongnu.org; Fri, 30 Apr 2010 04:20:35 -0400 Received: from [140.186.70.92] (port=35501 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7lSc-0007bl-4s for igraph-help@nongnu.org; Fri, 30 Apr 2010 04:20:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O7lSa-0006rx-PQ for igraph-help@nongnu.org; Fri, 30 Apr 2010 04:20:33 -0400 Received: from mtps02.sk.tsukuba.ac.jp ([130.158.97.224]:52670) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O7lSa-0006rM-5H for igraph-help@nongnu.org; Fri, 30 Apr 2010 04:20:32 -0400 Received: from dh99153.sk.tsukuba.ac.jp (dh99153.sk.tsukuba.ac.jp [130.158.99.153]) by mtps02.sk.tsukuba.ac.jp (Postfix) with ESMTP id 31FA28215; Fri, 30 Apr 2010 17:20:27 +0900 (JST) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: multipart/alternative; boundary=Apple-Mail-2-103167155 From: "MATSUDA, Noriyuki" In-Reply-To: Date: Fri, 30 Apr 2010 17:20:26 +0900 Message-Id: References: <56f66d361003021205n42ab9984v3fe72721919735a@mail.gmail.com> <56f66d361003150929q430aff43lcb95888fc42cc28e@mail.gmail.com> To: Help for igraph users X-Mailer: Apple Mail (2.1078) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [igraph] background color of rglplot() X-BeenThere: igraph-help@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Help for igraph users List-Id: Help for igraph users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 08:20:35 -0000 --Apple-Mail-2-103167155 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello: It will be very nice if we could specify the background color for = rglplot(). Is it possible? ________________________________ MATSUDA, N.= --Apple-Mail-2-103167155 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hello:
It will = be very nice if we could  specify the background color for =  rglplot().  Is it possible?

MATSUDA, = N.

rglplot(graph)
bg3d('white')

On Fri, Apr 30, 2010 at 9:20 AM, MATSUDA, Noriyuki wrote:
Hello:
=A0=A0It will be very nice if we could =A0s= pecify the background color for =A0rglplot(). =A0Is it possible?

________________________________

MATSUDA, N.

______= _________________________________________
igraph-help mailing list
igraph-help@nongnu.org
http://lists.nongnu.org/mailman/listinfo/igraph-help

--001485f6cece4dcc860485728646-- From MAILER-DAEMON Fri Apr 30 21:22:34 2010 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1O81Pe-0000dA-Er for mharc-igraph-help@gnu.org; Fri, 30 Apr 2010 21:22:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O81Pd-0000ch-D5 for igraph-help@nongnu.org; Fri, 30 Apr 2010 21:22:33 -0400 Received: from [140.186.70.92] (port=60813 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O81Pc-0000c0-7c for igraph-help@nongnu.org; Fri, 30 Apr 2010 21:22:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O81Pa-0001Mn-Ow for igraph-help@nongnu.org; Fri, 30 Apr 2010 21:22:32 -0400 Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]:33249) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O81Pa-0001MU-Fs for igraph-help@nongnu.org; Fri, 30 Apr 2010 21:22:30 -0400 Received: from infoshako.sk.tsukuba.ac.jp (webs01.sk.tsukuba.ac.jp [130.158.97.229]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id A7DD01535AE for ; Sat, 1 May 2010 10:22:27 +0900 (JST) Received: from 221.40.18.176 (SquirrelMail authenticated user mazda) by infoshako.sk.tsukuba.ac.jp with HTTP; Sat, 1 May 2010 10:22:27 +0900 (JST) Message-ID: <49194.221.40.18.176.1272676947.squirrel@infoshako.sk.tsukuba.ac.jp> In-Reply-To: References: <56f66d361003021205n42ab9984v3fe72721919735a@mail.gmail.com><56f66d361003150929q430aff43lcb95888fc42cc28e@mail.gmail.com> Date: Sat, 1 May 2010 10:22:27 +0900 (JST) Subject: Re: [igraph] background color of rglplot() From: mazda@sk.tsukuba.ac.jp To: "Help for igraph users" User-Agent: SquirrelMail/1.4.5-1_rh4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-2022-jp X-Priority: 3 (Normal) Importance: Normal Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: igraph-help@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Help for igraph users List-Id: Help for igraph users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 01:22:33 -0000 Hi Aaron: Thanks a lot. > eg: > > rglplot(graph) > bg3d('white') > > > On Fri, Apr 30, 2010 at 9:20 AM, MATSUDA, Noriyuki > wrote: > >> Hello: >> It will be very nice if we could specify the background color for >> rglplot(). Is it possible? >> >> ________________________________ >> >> MATSUDA, N. >> >> > _______________________________________________ > igraph-help mailing list > igraph-help@nongnu.org > http://lists.nongnu.org/mailman/listinfo/igraph-help