I'm trying to use an undirected_dfs to find cycles in a graph. I have a
visitor all ready to go, but I'm having trouble with the actual
undirected_dfs() call. It wants me to give it a vertex color map and an edge
color map, and I think that's where my problem is coming from.
I managed to get something that will compile, but when it runs, it goes to
the root node, then to one connected to it, then back to the root node, and
just repeats. I think what's happening is that the color maps aren't working
properly, so it doesn't know that the root node has already been discovered.
Can anyone take a look at this and let me know what I'm doing wrong and how
I can fix it? At this point I'm about ready to just write my own dfs
algorithm!
Thanks
-Kate
#include
#include
#include
#include
#include
#include <iostream>
#include "CycleFinder.h"
using namespace boost;
using namespace std;
//easier access to common types
typedef boost::adjacency_list Graph;
typedef boost::graph_traits<Graph>::vertex_iterator vertex_iterator;
typedef boost::graph_traits<Graph>::edge_iterator edge_iterator;
typedef boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
typedef boost::graph_traits<Graph>::edge_descriptor edge_descriptor;
int ConstraintsSolver::reduceClusterGraph(Graph cluster)
{
//search for 6-cycles and reduce them
pair vertexPair = vertices(cluster);
vertex_descriptor rootNode = *vertexPair.first;
CycleFinder finder;
read_write_property_map_archetype
vertexColorMap;
read_write_property_map_archetype
edgeColorMap;
undirected_dfs(cluster, finder, vertexColorMap, edgeColorMap, rootNode);
return 0;
}
--
View this message in context: http://www.nabble.com/-C%2B%2B--Problems-with-undirected_dfs-and-color-maps-...
Sent from the Boost - Users mailing list archive at Nabble.com.