Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] Static allocation of nodes and edges
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-11-08 16:13:29


On Fri, 8 Nov 2013, Sensei wrote:

>
>
> On Friday, November 8, 2013, Jeremiah Willcock wrote: 
> You can pass in a sequence (iterator range) of edges and the compressed_sparse_row_graph code will automatically count and sort them. Can you
> get that as a single entity (or a way to compute the edges), at least?
>
>
> Well, yes. Edges are computationally intensive, but can be computed. I'd like to avoid multiple copies of nodes/edges, since the graph can easily occupy 10
> gb of ram. 

OK.

> I have the list of nodes in a std container, for completeness of
> information. The edges are calculated by a functional on node pairs (ie,
> I need n^2 operations).

Even to find just n*k edges?

> I could create a list of pairs of nodes for edges, but I think it would
> defeat the purpose of using a graph, at least, if creating the graph
> involves copying all edges. If there were a sort of "moving semantics"
> with this respect, it would help a lot. 

If you can get aligned vectors of edge sources, targets, and edge
properties (if you have them), there is a constructor that effectively
moves out 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