如何將以下圖形輸出到graphml中?如何以graphml格式輸出有向圖?
typedef struct Vertex{ std::string name; std::string cmdb_id;
Vertex& operator= (const Vertex& rhs)
{
if (this == &rhs)
return *this;
name = rhs.name;
cmdb_id = rhs.cmdb_id;
}
bool operator< (const Vertex& rhs) const
{
return cmdb_id < rhs.cmdb_id;
};
bool operator== (const Vertex& rhs) const
{
return ((cmdb_id == rhs.cmdb_id) && (name == rhs.name));
};
}vertex_container;
typedef struct Edge {std::string name;} edge_container;
boost::directed_graph<vertex_container, edge_container> Graph g;
如果我編譯你的示例,我得到一個長的編譯器錯誤。我不會將它粘貼到這裏,它太長了。我使用gcc 4.6.3 btw。 – bayerb