[Lemon-user] "bad alloc" while populating graph
Balazs DEZSO
deba at inf.elte.hu
Thu Jun 7 13:30:43 CEST 2007
Hello
> > > I made a C++ program to build this graph using the lemon library.
> > > The code will create all the nodes and next will create the edges.
> > > The program work well for a small number of edges, but if I try to
> > > load all the edges in the database I obtain an error of "bal alloc"
> > > type when I've loaded about 33550000 edges.
The size of your graph is quite huge. It is possible that it could not be fit
into your memory. I think you should estimate the necessary place for your
graph.
Space(ListGraph(n, e)) = n * 16 byte + e * 24 byte
Space(SmartGraph(n, e)) = n * 8 byte + e * 16 byte
Space(NodeMap(n, T)) = n * sizeof(T) byte
Space(NodeMap(n, bool)) = n / 8 byte
Space(EdgeMap(n, T)) = e * sizeof(T) byte
Space(EdgeMap(n, bool)) = e / 8 byte
At most time we use vectors for storages which can double the necessary space
of the graphs and maps. So I suggest to make a short estimation about the
space requirements.
Best, Balazs
On Thursday 07 June 2007 10.48.19 andrea marino wrote:
> The version of the library is 0.6; I used g++ v3.4.2.
>
>
> thanks,
> andrea marino
>
> 2007/6/7, Alpár Jüttner <alpar at cs.elte.hu>:
> > Hi,
> >
> > Could you specify the lemon version you actually use?
> >
> > Regards,
> > Alpar
> >
> > On Thu, 2007-06-07 at 10:33 +0200, andrea marino wrote:
> > > Hi,
> > >
> > > I'm studying the lemon library, and for my graduation work I've to
> > > build the actor's graph.
> > > Every actor is a node of the graph and two actors are linked if they
> > > worked together.
> > > I made a C++ program to build this graph using the lemon library.
> > > The code will create all the nodes and next will create the edges.
> > > The program work well for a small number of edges, but if I try to
> > > load all the edges in the database I obtain an error of "bal alloc"
> > > type when I've loaded about 33550000 edges.
> > >
> > > The strange thing is that I have tried the program in Windows, Linux,
> > > MacOSX and the maximum number of edges loaded is the same...
> > >
> > > So I've made, using gdb, a stack trace of the error that I attach.
> > > Why can't I load more edges? Is a bug in my code or a limit of the
> > > library?
> > >
> > > Thanks,
> > >
> > > Andrea Marino
> > > _______________________________________________
> > > Lemon-user mailing list
> > > Lemon-user at lemon.cs.elte.hu
> > > http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
More information about the Lemon-user
mailing list