adjacency_list と subgraph アダプターを使用してグラフ タイプを作成しています。
#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 は正常に動作しますが、サブグラフ アダプターには使用できませんでした。ブースト サブグラフ アダプターではサポートされていないことがわかりました。そのため、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) 何らかの方法でブースト サブグラフを使用して「グラフ」にバンドルされたプロパティを使用できますか?
誰でも助けることができますか?
ありがとう、
プラティック