使用Boost进行拓扑排序::拓扑_排序

使用Boost进行拓扑排序::拓扑_排序,boost,generic-programming,topological-sort,Boost,Generic Programming,Topological Sort,我正在尝试使用boost的拓扑排序函数 我使用集合和列表的boost::adjacence_列表作为边和顶点的底层存储 typedef boost::adjacency_list<boost::setS, boost::listS, boost::bidirectionalS > SizerGraph; SizerGraph sizerGraph; typedef boost::graph_traits<SizerGraph>::vertex_de

我正在尝试使用boost的拓扑排序函数

我使用集合和列表的boost::adjacence_列表作为边和顶点的底层存储

typedef boost::adjacency_list<boost::setS, boost::listS, boost::bidirectionalS > SizerGraph;  
    SizerGraph sizerGraph;  
    typedef boost::graph_traits<SizerGraph>::vertex_descriptor Vertex;  
    boost::topological_sort(sizerGraph, std::ostream_iterator<Vertex>(std::cout, "\n"));
编译会导致错误。g++3.4.6

/usr/include/boost/property_map.hpp:349:错误:与不匹配 常量中的运算符+ boost::迭代器属性映射>, boost::adj_list_vertex_property_map, boost::detail::错误\未找到属性\常量 boost::detail::error\u property\u not\u found&,boost::vertex\u index\u t>, boost::默认颜色类型, boost::default\u color\u type&>*this->boost::iterator\u property\u map>, boost::adj_list_vertex_property_map, boost::detail::错误\未找到属性\常量 boost::detail::error\u property\u not\u found&,boost::vertex\u index\u t>, boost::默认颜色类型,boost::默认颜色类型&>::iter+ boost::get[使用PropertyMap= boost::adj_list_vertex_property_map, boost::detail::错误\未找到属性\常量 boost::detail::error\u property\u not\u found&,boost::vertex\u index\u t>, Reference=const boost::detail::error\u property\u未找到&,K= void*]const boost::put\u get\u helper, boost::detail::错误\未找到属性\常量 boost::detail::error\u property\u not\u found&,boost::vertex\u index\u t>

&const boost::put\u get\u helper, boost::detail::错误\未找到属性\常量 boost::detail::error\u property\u not\u found&,boost::vertex\u index\u t> *常量boost::调整列表顶点属性映射, boost::detail::错误\未找到属性\常量 boost::detail::error\u property\u未找到&, boost::顶点索引>*常量 boost::迭代器属性映射>, boost::adj_list_vertex_property_map, boost::detail::错误\未找到属性\常量 boost::detail::error\u property\u not\u found&,boost::vertex\u index\u t>, boost::默认颜色类型,boost::默认颜色类型&>此+ 8u,无效常数和无效*常数和v'

/usr/include/boost/graph/detail/adjancy_list.hpp:2264:错误:否 用于调用“get\u property\u valueboost::no\u property&”的匹配函数, boost::顶点索引

但是,使用VEC作为顶点的底层存储机制会导致干净的编译


我对顶点列表的使用是否违反了任何概念要求?

这只是一个猜测,但错误消息如下:

blah中的“operator+”不匹配。。迭代器

当您使用VecS时,您会得到一个向量,它的迭代器是随机访问的,并且支持操作符+


当您使用列表时,您会得到一个列表-其迭代器是双向的,不支持运算符+

您是正确的。然而,文档中说该图应该是VertexListGraph概念的模型。似乎这个概念不需要对顶点进行随机访问。如果我错了,请纠正我!嗨,谷歌搜索我找到的boost讨论组。我需要试一试。