[英]How to add custom edge label in boost graph?
我正在使用类型的提升图:
namespace boost {
struct computable_object_t
{
typedef vertex_property_tag kind;
};
}
typedef boost::property<boost::vertex_index_t, unsigned int,
boost::property<boost::computable_object_t,
plComputableObject*> > slVertexProperty;
typedef boost::property<boost::edge_weight_t, slScoreValueType> slEdgeProperty;
typedef boost::adjacency_list<boost::vecS, boost::listS, boost::bidirectionalS,
slVertexProperty, slEdgeProperty> slGraph;
现在,我必须为图形的每个边缘添加字符串类型的边缘标签,此外,我可以在程序中使用它们来区分不同类型的边缘。
请分享您的想法,谢谢。
您可以仅将新的label属性添加到edge属性列表中(删除命名空间):
typedef property<edge_weight_t, slScoreValueType,
property<edge_name_t, string> >
slEdgeProperty;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.