【发布时间】:2017-04-12 05:15:37
【问题描述】:
我不知道如何使用 boost 从 graphml 文件加载图形。我可以保存 graphml 文件,但无法加载。
我的图表有类型
typedef boost::labeled_graph<boost::adjacency_list<
boost::listS, boost::vecS, boost::directedS,
Vertex, Edge>, int> Graph;
Graph graph;
我的加载函数看起来像。
boost::dynamic_properties dp(boost::ignore_other_properties);
dp.property("IdV", boost::get(&Vertex::ID, graph.graph()));
dp.property("LabelV", boost::get(&Vertex::Name, graph.graph()));
dp.property("TypeV", boost::get(&Vertex::Type, graph.graph()));
dp.property("WeightE", boost::get(&Edge::Weight, graph.graph()));
dp.property("TypeE", boost::get(&Edge::Type, graph.graph()));
dp.property("LabelE", boost::get(&Edge::Name, graph.graph()));
std::ifstream dot(std::string(inputPath) + "");
boost::read_graphml(dot, graph.graph(), dp);
我收到此错误消息:
[ilink64 错误] 错误:未解决的外部 'boost::read_graphml(std::istream&, boost::mutate_graph&, 无符号 long long)' 引用自 ...\GRAPH_UNIT.O
谁能给我一个简单的好例子,如何在 boost.js 中读取 graphml 文件。我刚刚发现以下 2 个示例 - 我认为我的代码是一样的?
Boost read_graphml example 和 https://stackoverflow.com/questions/16667175/using-vertex-name-when-reading-a-graphml-file-with-boost-graph
或者有人可以在我的代码中看到错误吗?
最好的 迈克尔
【问题讨论】:
标签: c++ boost graph unresolved-external graphml