Boost logo

Boost :

From: Lodewijk Smit (lodewijk_smit_at_[hidden])
Date: 2004-04-06 03:45:25


Hi,

I tried to get an unique identifier for a node and an
edge. The node is possible e.g.:

adjacency_list<> someGraph;
std::pair<adjacency_list<>::vertex_iterator,adjacency_list<>::vertex_iterator>
p;
ed = add_edge(0,1, someGraph);
property_map< adjacency_list<> , vertex_index_t>::type
in;
  in = get(vertex_index_t(), someGraph);
  for (p = vertices(processGraph); p.first != p.second
; ++p.first) {
    cout << *p.first << "\n";
    cout << "index: " << in[*p.first] << " \n";
  }

However, the same idee does not work for an edge:

std::pair<adjacency_list<>::edge_iterator,adjacency_list<>::edge_iterator>
pe;
  property_map< adjacency_list<> , edge_index_t>::type
inedge;
  inedge = get(edge_index_t(), processGraph);
  for (pe = edges(someGraph); pe.first != pe.second;
++pe.first) {
    cout << *pe.first << " ";
    cout << "index: " << inedge[*pe.first] << " \n";
  }

I can not figure out how to get an unique id for an
edge and I can not understand how the property maps
works from the documentation nor I can find how such a
edge_index_t property is defined. Can somebody provide
some help.

With kind regards,

Lodewijk

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk