Boost logo

Boost :

From: lums_at_[hidden]
Date: 2001-03-12 08:44:45


I assume you are getting a run-time error of some kind?

Are you running out of memory?

Back of my envelope says:

Taking a quick look without trying to compile or to run the code, it
looks like you are inserting 17 edges per node in a graph of size
256k. This is about 4.25M edges, each of which takes a double at 8
bytes for 36MB. Adding 8 more bytes for representing the edge on the
in_edges and out_edges brings us up to 72MB.

With some more overhead here or there, this could get somewhat
larger. This is still what *I* would call a moderately sized graph,
however, if you are using a PC (implied by VC++), this might be
pushing it.

--- In boost_at_y..., hankel_o_fung_at_y... wrote:
> VC++ 6.0 SP5 seems unable to handle a moderately large graph.
> Is it my mistake or VC++'s? Any workaround?
>
> Hankel
>
> #include <boost/graph/adjacency_list.hpp>
> #include <iostream>
> using namespace std;
> using namespace boost;
>
> typedef adjacency_list< listS, vecS, undirectedS,
> no_property, property<edge_weight_t, double> > Graph;
>
> int const N = 512;
> int index(int i, int j) { return i*N + j; }
>
> int main()
> {
> Graph G(N*N);
>
> for (int i=0; i<N-1; ++i)
> {
> cout << i << flush;
> for (int j=0; j<N; ++j)
> {
> int begin = (j-8 < 0 ? 0 : j-8);
> int end = (j+8+1 > N ? N : j+8+1);
> for (int k=begin; k<end; ++k)
> put(edge_weight, G, add_edge(index(i,j), index(i+1,k),
> G).first, 1.0);
> // this is simplified -- in my original program G hasn't a
> regular structure
> }
> cout << endl;
> }
>
> return 0;
> }


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk