On Fri, 8 May 2009, arm2arm wrote:
Hello, Are there ways to generate Graph with edges by the user defined function? Should I generate Vertex relations by hand then put it in to Graph? I would like to feed graph by points 3d and each point is linked to its closest neighbor by distance. Then as a next step I would like to dig in the graph the sub-graphs with the given linking length.
Sorry -- I misunderstood your question and assumed you wanted to create a grid on a 3-D lattice. If you already have a list of vertex pairs that you want to use as edges, just pass the begin and end iterators of that list (vector, etc.) to the graph constructor. If you are willing to sort the vertex pairs in advance and will not be mutating the graph's structure, you can use compressed_sparse_row_graph to save memory and computation time. Is that closer to what you wanted? I don't fully understand what you are computing from the points and what you want the BGL graph to contain. -- Jeremiah Willcock