I want to add a vertex, which a string as its ID to a graph if a vertex
representing such a string does not exist in the graph. Is there a function
call to test if a vertex exists in a graph?
-----------------------------------------------------------------------
//Here is the simpilfied situation that I want to handle, "IF THERE IS NOT
a vertex representing the //string of the current line" is the predicate I
want to know
typedef adjacency_list,
property > Graph;
Graph g();
ifstream infile;
infile.open(argv[1]);
string line;
while( getline(infile, line) ){
if(line.find("Node")!= npos && /*IF THERE IS NOT a vertex representing
the string of the current line*/)
add_vertex( line, g);
}
--------------------------------------------------------------------
A related question I want to ask is whether there exist a function call that
test whether an edge representing [vertext string("Node1") --> vertext
string("Node2") ] exists in a graph.
Thanks a lot,
Sean
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/