[BGL] kruskal_minimum_spanning_tree

The following code used to work, but no longer does. typedef boost::adjacency_list<> G; typedef boost::graph_traits<G>::edge_descriptor E; G graph; std::vector<E> spanning_tree; boost::kruskal_minimum_spanning_tree( graph , std::back_inserter(spanning_tree) ); Somehow the concept checking became too restrictive, and type E is now expected to be Assignable, which currently doesn't seem to be the case. Any fixes or workarounds? Cromwell D. Enage __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

On Jun 2, 2006, at 10:29 AM, Cromwell Enage wrote:
The following code used to work, but no longer does.
typedef boost::adjacency_list<> G; typedef boost::graph_traits<G>::edge_descriptor E; G graph; std::vector<E> spanning_tree; boost::kruskal_minimum_spanning_tree( graph , std::back_inserter(spanning_tree) );
FWIW, I changes the typedef of G to: typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::no_property, boost::property<boost::edge_weight_t, double> > G; since we need an edge weight to use Kruskal's algorithm.
Somehow the concept checking became too restrictive, and type E is now expected to be Assignable, which currently doesn't seem to be the case.
Any fixes or workarounds?
Which compiler is this? I found (and, just now, suppressed) a warning on GCC 3, but the code above compiles for me on GCC 3.3 and 4.0.1. Perhaps my change will fix the problem you are seeing? Doug

--- Douglas Gregor wrote:
On Jun 2, 2006, at 10:29 AM, Cromwell Enage wrote:
The following code used to work, but no longer does.
typedef boost::adjacency_list<> G; typedef boost::graph_traits<G>::edge_descriptor E; G graph; std::vector<E> spanning_tree; boost::kruskal_minimum_spanning_tree( graph , std::back_inserter(spanning_tree) );
FWIW, I changes the typedef of G to:
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::no_property, boost::property<boost::edge_weight_t, double> > G;
since we need an edge weight to use Kruskal's algorithm.
A transcription error on my part. Yes, my graph has an internal property map that stores edge weights.
Which compiler is this?
GCC 3.4.2 (MSYS/MinGW). The algorithm checks if std::back_inserter(spanning_tree) is an OutputIterator; in doing so, it checks if E is Assignable. Cromwell D. Enage __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
participants (2)
-
Cromwell Enage
-
Douglas Gregor