簡體   English   中英

如何在增強圖中添加自定義邊緣標簽?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM