<div dir="ltr">The graph size can be a problem:<div style>A smart graph arc occupies 16 bytes. If you count the arcs in the graph, they require ~1.6G space, but because of we are using vector, it will be 2G.</div><div style>

<br></div><div style>If you want to use full graph of this size, please consider to use FullGraph or FullDigraph (or of course, you can buy some additional RAM).</div><div style><br></div><div style>Balazs</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Thu, Mar 7, 2013 at 1:14 PM, Oláh Barbara <span dir="ltr"><<a href="mailto:olahb@caesar.elte.hu" target="_blank">olahb@caesar.elte.hu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
<br>
I'm new to lemon. I'd like to generate a full graph with 10.000 nodes,<br>
and I've got this error:<br>
<br>
terminate called after throwing an instance of 'std::bad_alloc'<br>
   what():  std::bad_alloc<br>
<br>
Do you have any idea what was the problem? I was wondering, is there any<br>
limit for the graph size?<br>
<br>
I use 4.7.2. version of g++compiler and Ubuntu 12.10 (32 bit) operating<br>
system.<br>
<br>
My code:<br>
<br>
#include <iostream><br>
#include <lemon/smart_graph.h><br>
#include <lemon/core.h><br>
<br>
using namespace std;<br>
using namespace lemon;<br>
<br>
int main()<br>
{<br>
     SmartDigraph g;<br>
<br>
     int NodeNumber = 10000;<br>
<br>
     for(int i = 0; i < NodeNumber; i++)<br>
         g.addNode();<br>
<br>
     std::cout << "Nodes have been add." << std::endl;<br>
<br>
     //Generate full graph<br>
     for (SmartDigraph::NodeIt u(g); u != INVALID; ++u)<br>
         for (SmartDigraph::NodeIt v(g); v != INVALID; ++v)<br>
             if (u != v) g.addArc(u, v);<br>
     std::cout << "Generated full graph." << std::endl;<br>
<br>
     return 0;<br>
}<br>
<br>
<br>
Thank you,<br>
Barbara Oláh<br>
_______________________________________________<br>
Lemon-user mailing list<br>
<a href="mailto:Lemon-user@lemon.cs.elte.hu">Lemon-user@lemon.cs.elte.hu</a><br>
<a href="http://lemon.cs.elte.hu/mailman/listinfo/lemon-user" target="_blank">http://lemon.cs.elte.hu/mailman/listinfo/lemon-user</a><br>
</blockquote></div><br></div>