
On 12 January 2011 16:36, Cedric Laczny
Hi,
it seems to me, that you are very well adding an edge, but forgetting to insert its properties, that you want to retrieve.
Please s. code below.
Hi Cedric, Thank you for your quick reply.
You do add an edge, but this in the same as for vertices, it is only an edge descriptor. There is no additional information (as the properties) associated with it, yet.
This information has not yet been set! I would expect the same as in AddNode() here: m_graph[edgeDescriptor] = pEdge; Retrieving this information when first adding an edge is counter-intuitive. Of course you need to pass pEdge as an argument to AddEdge().
My bad! Now I realise that I forget to assign pEdge to the edge
descriptor. So at the beginning of the function I add this line, which
basically calls the parent class' AddEdge function to retrieve the
corresponding Edge information:
Edge
Hope that helps. BTW, have you already thought about using vecS for the VertexList (instead of listS)? It has the advantage of automatically creating vertex indices which are crucial to most BGL algorithms.
I think I am clueless about this issue. After searching around, I found about that in http://www.systomath.com/include/Boost-1_36/libs/graph/doc/quick_tour.html I am a new BGL user, and haven't noticed how automatically created vertex indices can be useful. Could you please give some information? Currently I choose listS over vecS because in some operations, listS is faster than vecS, as written in: http://www.boost.org/doc/libs/1_44_0/libs/graph/doc/using_adjacency_list.htm... Thank you for bringing that up.
Best,
Cedric
Best regards, Nicholas Mario Wardhana