
On Sat, 24 Apr 2010, Dan Jiang wrote:
Is there any way for CSR graph to provide a constructor that takes a file stream pointer or a callback functor? If not, how hard is it to add it? I am using edges_are_sorted CSR constuctor. It doubles memory I passed in during constructor calls. My graph is huge (>30 million arcs) and It took >8gb ram to construct my CSR. If I can have callback or file-based construction, I could cut down the memory usage by half.
You can use arbitrary iterators in most of the constructors, including the one you are using. You can use Boost.Iterator to create a custom iterator for your file data structure and use that with the CSR constructors. Note that some of the unsorted ones require multi-pass iterators, which would be harder to implement on top of a file, but edges_are_sorted is single-pass. -- Jeremiah Willcock