[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] igraph-help Digest, Vol 78, Issue 10
From: |
Abby Rudolph |
Subject: |
Re: [igraph] igraph-help Digest, Vol 78, Issue 10 |
Date: |
Fri, 25 Jan 2013 14:51:08 -0500 |
Hi,
Thank you for your previous suggestions. I managed to get access to a server
and was able to run my simulation code without a problem. However, I am still
having problems running it from my work computer which does not have access to
the server. I increased the memory for my work computer and it now has 16GB of
memory and is a 64-bit machine. I am able to get through the shortest path
code without a problem, but when I enter the simulation code that follows:
For (deg in 1:6) (
Loc <-which (sp==deg)
Names<-V(g1)$name
Hes<-loc%%dim(sp)[1]
Hes[hes==0]<-dim(sp)[1]
Has<-trunc(loc/dim(sp)[1])+1
Ids<-unique(c(names[hes],names[has]))
Etc...
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?
Since my computer has 16 GB of memory, this doesn't make sense. I've seen
others with a similar post online and was wondering if anyone had any solutions.
I've tried changing the code from For (deg in 1:6) to For (deg in 1:1) to
reduce the iterations, but I get the same memory error. Any suggestions would
be greatly appreciated.
Thanks,
Abby
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of address@hidden
Sent: Saturday, January 19, 2013 12:01 PM
To: address@hidden
Subject: igraph-help Digest, Vol 78, Issue 10
Send igraph-help mailing list submissions to
address@hidden
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.nongnu.org/mailman/listinfo/igraph-help
or, via email, send a message with subject or body 'help' to
address@hidden
You can reach the person managing the list at
address@hidden
When replying, please edit your Subject line so it is more specific than "Re:
Contents of igraph-help digest..."
Today's Topics:
1. Re: igraph-help Digest, Vol 78, Issue 9 (Abby Rudolph)
2. Re: igraph-help Digest, Vol 78, Issue 9 (Tam?s Nepusz)
----------------------------------------------------------------------
Message: 1
Date: Fri, 18 Jan 2013 12:29:20 -0500
From: Abby Rudolph <address@hidden>
To: "address@hidden" <address@hidden>
Subject: Re: [igraph] igraph-help Digest, Vol 78, Issue 9
Message-ID:
<address@hidden>
Content-Type: text/plain; charset="us-ascii"
Thank you for your suggestions!
I need to calculate the shortest paths for all 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 and if so, will this save
memory? I could even restrict it to sp<=4 if that would help more?
If I do shortest.paths(g1, v=1)
And repeat this for each edge, will they all be stored? And can they be called
upon again in the follow up code:
For (deg in 1:6) (
Loc <-which (sp==deg)
Names<-V(g1)$name
Hes<-loc%%dim(sp)[1]
Hes[hes==0]<-dim(sp)[1]
Has<-trunc(loc/dim(sp)[1])+1
Ids<-unique(c(names[hes],names[has]))
Etc...
Thanks,
Abby
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of address@hidden
Sent: Friday, January 18, 2013 12:01 PM
To: address@hidden
Subject: igraph-help Digest, Vol 78, Issue 9
Send igraph-help mailing list submissions to
address@hidden
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.nongnu.org/mailman/listinfo/igraph-help
or, via email, send a message with subject or body 'help' to
address@hidden
You can reach the person managing the list at
address@hidden
When replying, please edit your Subject line so it is more specific than "Re:
Contents of igraph-help digest..."
Today's Topics:
1. Exception when trying to call count_subisomorphisms_vf2
(Stephen Ray)
2. Re: Exception when trying to call count_subisomorphisms_vf2
(Tam?s Nepusz)
3. igraph memory error (Abby Rudolph)
4. Re: igraph memory error (G?bor Cs?rdi)
5. Re: igraph memory error (Tam?s Nepusz)
6. Re: Exception when trying to call count_subisomorphisms_vf2
(Stephen Ray)
----------------------------------------------------------------------
Message: 1
Date: Fri, 18 Jan 2013 14:45:07 +0000
From: Stephen Ray <address@hidden>
To: "address@hidden" <address@hidden>
Subject: [igraph] Exception when trying to call
count_subisomorphisms_vf2
Message-ID:
<address@hidden>
Content-Type: text/plain; charset="us-ascii"
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 exception "argument 1 must be igraph.Graph, not
instance".
I am running igraph 0.6 using the Python interface (2.7.2) on Windows 7.
Thanks in advance.
Stephen Ray
Chief Technology Officer
Cobb Systems Group, LLC
Rockville Innovation Center
155 Gibbs Street
Suite 514
Rockville, MD 20850
United States of America
Office: 301-515-1230
Cell: 240-888-6507
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.nongnu.org/archive/html/igraph-help/attachments/20130118/b1f33dae/attachment.html>
------------------------------
Message: 2
Date: Fri, 18 Jan 2013 16:03:36 +0100
From: Tam?s Nepusz <address@hidden>
To: Help for igraph users <address@hidden>
Subject: Re: [igraph] Exception when trying to call
count_subisomorphisms_vf2
Message-ID: <address@hidden>
Content-Type: text/plain; charset=windows-1252
> 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 exception ?argument 1 must be igraph.Graph, not
> instance?.
This seems to work for me; e.g.:
>>> g1 = Graph.GRG(100, 0.2)
>>> g2 = Graph.Ring(4)
>>> g1.count_subisomorphisms_vf2(g2)
81472
What does type(g1) and type(g2) say?
Best,
Tamas
------------------------------
Message: 3
Date: Fri, 18 Jan 2013 09:53:45 -0500
From: Abby Rudolph <address@hidden>
To: "address@hidden" <address@hidden>
Subject: [igraph] igraph memory error
Message-ID:
<address@hidden>
Content-Type: text/plain; charset="us-ascii"
Hello,
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 I am
getting memory errors (64-bit machine) or the program is crashing (32-bit
machine).
Using the code
sp<-shortest.paths(g1,mode="all")
I get the error:
Error in shortest.paths(g1) :
At vector.pmt:409 : cannot reserve space for vector, Out of memory
I noticed that others have had similar errors, but I cannot find a solution to
this problem that works for me.
On other occasions, when I run the same code, I get the following:
In addition: Warning messages:
1: In print.default(m, ..., quote = quote, right = right) :
Reached total allocation of 3891Mb: see help(memory.size)
2: In print.default(m, ..., quote = quote, right = right) :
Reached total allocation of 3891Mb: see help(memory.size)
3: In print.default(m, ..., quote = quote, right = right) :
Reached total allocation of 3891Mb: see help(memory.size)
4: In print.default(m, ..., quote = quote, right = right) :
Reached total allocation of 3891Mb: see help(memory.size)
> for (i in 1:vcount(g1)) sp<-shortest.paths(g1,v=i)
Error in shortest.paths(g1, v = i) :
At iterators.c:722 : Cannot create iterator, invalid vertex id, Invalid
vertex id In addition: Warning message:
In shortest.paths(g1, v = i) :
Reached total allocation of 3891Mb: see help(memory.size)
Any help would be greatly appreciated.
Thanks!
Abby
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.nongnu.org/archive/html/igraph-help/attachments/20130118/d6106f65/attachment.html>
------------------------------
Message: 4
Date: Fri, 18 Jan 2013 10:18:59 -0500
From: G?bor Cs?rdi <address@hidden>
To: Help for igraph users <address@hidden>
Subject: Re: [igraph] igraph memory error
Message-ID:
<address@hidden>
Content-Type: text/plain; charset="iso-8859-1"
Hi,
to store the shortest paths matrix for the whole graph, you would need 23295
* 23295 * 8 bytes of memory, which is more than 4 Gb. You cannot allocate a
memory chunk of that size on 32 bit machines. On 64 bit machines it is
theoretically possible, but not in R, because R has some (smaller than 4Gb)
limits for the size of a vector.
You can calculate the shortest paths from a couple of vertices only, the ones
you really need. Or do all vertices in parallel, on multiple cores/machines if
you really need all of them, and then store them on disk.
Gabor
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.nongnu.org/archive/html/igraph-help/attachments/20130118/0c5bf0e9/attachment.html>
------------------------------
Message: 5
Date: Fri, 18 Jan 2013 16:33:31 +0100
From: Tam?s Nepusz <address@hidden>
To: Help for igraph users <address@hidden>
Subject: Re: [igraph] igraph memory error
Message-ID: <address@hidden>
Content-Type: text/plain; charset=us-ascii
> 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 I am getting memory errors
The result of the shortest path matrix calculation would be a matrix of 23295 x
23295, and obviously R cannot handle matrices of such a size. However, I
strongly suspect that you won't need the whole matrix at once, in which case
you can simply call shortest.paths(g1, v=1), which will calculate the shortest
path lengths originating from vertex 1 to all the other vertices. You can do it
for multiple vertices at once (just supply a vector for v), the point is that
you shouldn't do it for all the vertices at once. If you need the actual
shortest paths instead of their lengths, use get.shortest.paths in a similar
manner.
--
T.
------------------------------
Message: 6
Date: Fri, 18 Jan 2013 15:14:42 +0000
From: Stephen Ray <address@hidden>
To: Help for igraph users <address@hidden>
Subject: Re: [igraph] Exception when trying to call
count_subisomorphisms_vf2
Message-ID:
<address@hidden>
Content-Type: text/plain; charset="iso-8859-1"
...open mouth insert foot time....
I had an error in passing the g2 to the method call - it was not a graph (which
is what the error message was telling me).
Thanks for pointing me in the right direction.
Steve R
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Tam?s Nepusz
Sent: Friday, January 18, 2013 10:04 AM
To: Help for igraph users
Subject: Re: [igraph] Exception when trying to call count_subisomorphisms_vf2
> 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 exception "argument 1 must be igraph.Graph, not
> instance".
This seems to work for me; e.g.:
>>> g1 = Graph.GRG(100, 0.2)
>>> g2 = Graph.Ring(4)
>>> g1.count_subisomorphisms_vf2(g2)
81472
What does type(g1) and type(g2) say?
Best,
Tamas
_______________________________________________
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
End of igraph-help Digest, Vol 78, Issue 9
******************************************
------------------------------
Message: 2
Date: Fri, 18 Jan 2013 23:55:21 +0100
From: Tam?s Nepusz <address@hidden>
To: Help for igraph users <address@hidden>
Subject: Re: [igraph] igraph-help Digest, Vol 78, Issue 9
Message-ID: <address@hidden>
Content-Type: text/plain; charset=us-ascii
> 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't -- you can filter the paths after you've got them. I would set
up a for loop that loops over all the vertices, calculate the shortest paths
from a single vertex to all the others using get.shortest.paths (note that this
gives you only _one_ shortest path between any vertex pair A-B, even if there
are multiple shortest paths between A and B -- if you need them all, use
get.all.shortest.paths), remove those for which the length is larger than 6,
and then concatenate all the paths you've seen into a huge list. Or store them
in a file. But still, depending on the structure of your graph, you might end
up with _many_ shortest paths, in which case storing all of them will not be an
option.
--
T.
------------------------------
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
End of igraph-help Digest, Vol 78, Issue 10
*******************************************
- Re: [igraph] igraph-help Digest, Vol 78, Issue 10,
Abby Rudolph <=