2
我有一個圖形,我想將其類型更改爲子圖形,以便能夠將其劃分爲更多的子圖形以獲得更多與graphviz的縱座標打印。 問題是,當我將子圖正確添加到我的圖中時,頂點描述符不再起作用。修改前子圖的圖形特徵
代碼:
#include "Node.cpp"
#include <boost/graph/adjacency_list.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/subgraph.hpp>
using namespace boost;
typedef subgraph<adjacency_list<vecS, vecS, directedS, Node, property < edge_weight_t, float > > >mygraph;
typedef graph_traits <mygraph>::vertex_descriptor vertex_descriptor; //ERROR
...
是什麼問題:
#include "Node.cpp"
#include <boost/graph/adjacency_list.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/subgraph.hpp>
using namespace boost;
typedef adjacency_list<vecS, vecS, directedS, Node, property < edge_weight_t, float > > mygraph;
typedef graph_traits <mygraph>::vertex_descriptor vertex_descriptor;
...
代碼更改圖形以子後?我該如何解決它?
它編譯但edge_weight屬性用於以後在我的代碼中,所以我不能用edge_index替換它,有沒有辦法解決? – W4lker
@ W4lker我很確定你可以結合邊緣屬性。畢竟,這是屬性被標記爲_('edge_index_t'和'edge_weight_t'爲_tags_)的全部原因。如果我有時間,我會爲你閱讀文檔:) – sehe
是的!輝煌!我忘了自定義標籤設置!謝謝! – W4lker