Boost logo

Boost Users :

Subject: Re: [Boost-users] Re ducing adjacency_list's memory usage
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2009-05-04 09:52:37


On Sun, 3 May 2009, behzad wrote:

> I wanted to ask if anybody knows how I can reduce memory usage of adj_list
> graph, even by eliminating some of it's features.
>
> Any help is greatly appreciated.

Which vertex list and out-edge list types are you using? If you do not
need stable vertex numbers after deletion, and don't need stable vertex
iterators, try switching VertexList to vecS. If you do not need stable
edge iterators, try switching OutEdgeList to vecS. Are you mutating your
graph at all? If you have a directed graph that is not being mutated,
with all edges known up front, you can use compressed_sparse_row_graph to
save even more memory; note that, as of SVN head, you don't need to
pre-sort the edges if you can accept having two passes performed over the
input edge range. I can back-port that code to 1.39 if you want to go
that way. The options I presented all assume you can tolerate parallel
edges; you are more limited if you need automatic detection of those.

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net