On Mon, Nov 10, 2008 at 4:14 PM, DGaffney <[EMAIL PROTECTED]> wrote: > > > Basically, the error is as such: > > Our error is that when we use data of list length > 600ish, for some > reason sage hangs. We know that this is not because we are impatient, > and that it is actually working, because when the list length is under > 600ish, it generates almost instantly. We want to be able to go to > list lengths of over 2000, so this proves to be a deal breaker. We > were originally using all of the node names as hash strings of the > content, but we optimized it so we have smaller corresponding numbers > that relate to each piece of content that we are interested in. Still, > this has yielded no significant change. We think that this either is a > problem with the allowed length of lists in Sage, but python has an > allowable list length of around 2 billion, so that seems unlikely. We > also wonder if there is possibly some memory cap that is reached with > our data, but if it is that, the memory cap seems unreasonably small. > Either way, any suggestions/workarounds would be greatly appreciated. > If there is another library that would be better suited to these > needs, just naming that would help us out a ton. Thanks much everyone! > > Devin, Ian, and Max > > [EMAIL PROTECTED] > [EMAIL PROTECTED] > [EMAIL PROTECTED] > > Sample data of what we have been putting into sage can be downloaded > here: http://www.devingaffney.com/files/data.txt > > We are trying to build a program as stipulated here: > http://www.devingaffney.com/wikipedia-network-maps. > > The basic thing we are inputting into sage when it hangs is this: > > g = [data.txt file that is mentioned above] //this is where the hang > occurs; even declaring g with "too much" data makes sage hang up. > > G = Graph(g) > G.show()
I'm not sure what you're doing wrong, but in the below session I load the above data file, parse it, then display the plot, and it takes only about 2 seconds total and only a few megabytes of RAM: bsd:~ was$ sage ---------------------------------------------------------------------- | SAGE Version 3.1.4, Release Date: 2008-10-20 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: get_memory_usage() '128M+' sage: time a = eval(open(get_remote_file('http://www.devingaffney.com/files/data.txt')).read()) Attempting to load remote file: http://www.devingaffney.com/files/data.txt Loading: [........] CPU times: user 0.05 s, sys: 0.03 s, total: 0.09 s Wall time: 0.42 s sage: get_memory_usage() '128M+' sage: a[632] [142, 139, 75] sage: time G = Graph(a) CPU times: user 0.19 s, sys: 0.19 s, total: 0.38 s Wall time: 1.46 s sage: time G.show() CPU times: user 1.98 s, sys: 0.05 s, total: 2.03 s Wall time: 2.32 s sage: get_memory_usage() '142M+' The default 2d plot that comes up looks like crap, unfortunately. This kind of looks like something: sage: G.plot(vertex_labels=0,vertex_size=0.1,layout='circular').show(figsize=[20,15]) If you remake the plot, but delete vertex 635, the plot looks *dramatically* better: sage: del a[635] sage: G = Graph(a) sage: G.plot(vertex_size=0.1).show(figsize=[20,15]) --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---