Boost logo

Boost Users :

Subject: [Boost-users] Accessing the edge through edge descriptor with bundled properties
From: giridhar (giridharms_at_[hidden])
Date: 2011-10-24 13:27:11


Hello All,

   I have to access an edge in a vector called border_edge through an edge
descriptor. For example

for( vector<Edge>::iterator j=border_edge.begin();j!=border_edge.end();++j)
 {
Edge e = t1[*j]; // I am getting error saying that No suitable conversion
for Edge to Edgep exits
 }

*Details*:
border_edge is of type std::vector<Edge> border_edge(10);

Graph as: typedef subgraph< adjacency_list<vecS, vecS, undirectedS,
   Vertexp, property< edge_index_t, unsigned int, Edgep > > > Graph;

typedef Graph::edge_descriptor Edge;

I have exterior Edge property defined as

struct Edgep
{
int edge_index;
int edge_w;
std::string edge_name;
int capacity;
int residual_capcity;
int bandwidth_used;
};

Whenever I am adding edges into graph I am updating this border_edge vector.
Say I am adding an edge from vertex 0 to 4 then I am doing this
border_edge[i] = (add_edge(0,4,t)).first; //i is an example index. It is
actually running in the loop.

Can anyone please give some suggestions regarding this. How to access this
edge which is inside vector? or what descriptor type should I use?

-- 
Regards,
Giridhar


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