boost-property-map

    2熱度

    1回答

    我正嘗試使用boost::graph,它的頂點屬性中包含enum。當我嘗試使用boost :: dynamic_property的捆綁屬性時,問題就開始了。看起來我無法獲得boost :: lexical_cast識別類型的正確模板專門化。 #include <string> #include <iostream> #include <boost/lexical_cast.hpp> #inc

    2熱度

    2回答

    我目前正在嘗試定義boost圖的外部屬性。我使用一些捆綁的屬性內部的: struct VertexProperties { int demand; }; struct EdgeProperties { uint capacity; int cost; }; typedef adjacency_list <vecS, vecS, bidirectiona

    3熱度

    1回答

    我正在學習Boost圖庫的Fruchterman-Reingold算法。通過閱讀文檔,我知道算法是根據圖形佈局計算所有節點的位置,但是我的問題是我無法理解Boost圖庫中吸引力的計算步驟。 例如,如果該拓撲結構是具有高度100和寬度100的矩形,每個頂點被標記爲字符串,並且每對頂點爲之間的關係: "0" "5" "Kevin" "Martin" "Ryan" "Leo" "Y" "S" "

    2熱度

    1回答

    我在努力將boost::graph算法的使用轉化爲一組新的實現類。我想知道:如果boost::graph只存儲std::shared_ptr引用,是否可以訪問對象的屬性?就像下面這個: class Vert { public: Vert(); Vert(std::string n); std::string getName() const; void se

    2熱度

    1回答

    我正在做Boost :: Graph的第一步,遇到一些(對我)意想不到的行爲。 我想要的是具有一系列edge_weight屬性(該數字僅在運行時已知),並使用滿足某些約束條件的所有權重中的最小值。首先,typedef聲明: typedef adjacency_list<vecS, vecS, undirectedS, property<vertex_distance_t, int>, proper

    1熱度

    1回答

    如何在這個標記圖中添加權重,使用add_edge_by_label在dijkstra_shortest_paths中使用? 想使用一個example 感謝 #include <boost/graph/adjacency_list.hpp> #include <boost/graph/copy.hpp> #include <boost/graph/labeled_graph.hpp> #inc

    1熱度

    1回答

    在BGL的背景下,我需要迭代in_edges和out_edges,但是我想排除那些屬於反向邊緣的部分,即排除那些屬於反向邊緣property_map的部分。下面的代碼顯示,我想這樣做,但當然property_map沒有find和end方法是什麼。 UPDATE: 一種可能的解決辦法是維持像含有反向邊緣同時建立曲線圖中的地圖的單獨的結構。這將工作,如果我有圖大廈的控制,但我沒有,因爲我使用的功能re