Why am I not hearing that my edge has already been added?

I am writing a simple graph app. The edges have an unsigned integer property
that is incremented every time I "add" an edge from one given node to
another, thus, any given edge has an "instance" of at least one, but if
there are, say, three edges from node A to node B, edge A->B has nInstances
== 3.
To do this I would like to attempt to add an edge between nodes, and if the
edge has already been added, just bump the counter for that edge, otherwise,
set the counter to 1. My basic approach is to call tie(edge_iter, boolflag)
= add_edge(v0, v1, graph). If boolvar is set to false then the edge already
was in the graph.
The problem is that add_edge() never clears boolvar - it is always true,
even when I coerce redundant edges, as in the following code:
#include "stdafx.h"
#include

The problem is that add_edge() never clears boolvar - it is always true, even when I coerce redundant edges, as in the following code:
the problem is that your graph allows parallel edges, therefor the adding always succeeds. you would have to check for existing edges via out_edges(va). cheers, moritz

OK, thanks. Now how do I declare a graph that does not allow parallel edges?
---------- Forwarded message ----------
From: moritz Hilger
even when I coerce redundant edges, as in the following code:
the problem is that your graph allows parallel edges, therefor the adding always succeeds. you would have to check for existing edges via out_edges(va). cheers, moritz _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Eric Fowler
-
moritz Hilger