hello, I'm using boost for the very first time and I'm having big problems in understanding how to proceed. I'm working in C++, and my aim would be creating a graph where each node is a 2D point and each edge is the distance between two points. I'd like to be able to say "vertex 0 and vertex 1 are 5mm apart". How to do that? This is what I got so far: typedef boost::adjacency_matrixboost::undirectedS Graph; class myClass { private: int numberOfNodes; Graph *g; char* name; public: myClass(int); addVertex(float,float,int); void addEdge(int[2],int); }; myClass::myClass(int number)fNodes){ g = new Graph(number_of_nodes); } myClass::addVertex(float x,float y) { add_edge(x,y,*g); } Now this seems to work, but how to incorporate coordinates? Thanks a lot for your help! Ale
participants (1)
-
Figa Pelosa