2
我正在使用adjacency_list和子圖適配器來創建我的圖形類型。如何訪問增強子圖的'圖'屬性?
#include <boost/graph/subgraph.hpp>
#include <boost/graph/adjacency_list.hpp>
struct VertexProperties
{
bool bIsExpandable;
string sId;
string sCoord_X;
string sCoord_Y;
std::size_t order;
};
struct EdgeProperties
{
string sId;
bool bBidirectional;
};
//Graph properties
enum graph_index_t {graph_index=111};
namespace boost{
BOOST_INSTALL_PROPERTY(graph,index);
}
typedef boost::property<boost::vertex_index_t, std::size_t , VertexProperties> vertex_prop;
typedef boost::property<boost::edge_index_t, std::size_t , EdgeProperties> edge_prop;
typedef boost::property<graph_index_t, std::size_t> graph_prop;
typedef boost::adjacency_list<
boost::listS,
boost::vecS,
boost::bidirectionalS,
vertex_prop ,
edge_prop,
graph_prop>
Graph;
typedef boost::subgraph<Graph> Subgraph;
我正在使用頂點和邊的捆綁屬性。我試圖給捆綁的屬性'圖',爲adjacency_list它工作正常,但不能用於子圖適配器,我發現它不支持由boost子圖適配器。所以我將graph_index_t添加到圖屬性中,但我無法訪問它。我寫了下面的屬性映射來訪問它,但它似乎並不是正確的方式。
typedef property_map<Subgraph , graph_index_t>::type GraphIndexPropertyMap;
它給出了adjacency_list.hpp
d:\boost_1_53_0\boost\graph\detail\adjacency_list.hpp:2543: error: forming reference to void
我已籤提升1.53文檔,但無法找到與此相關的方式錯誤。
所以我有2個問題:
1)如何獲得讀寫到graph_index屬性訪問?
2)我可以以某種方式使用帶有子圖的'圖'的捆綁屬性嗎?
任何人都可以幫忙嗎?
感謝,
PRATIK