I have a file named "test.dot" something like,
graph {
0;
1;
0 -- 1;
}
//EOF
I want to read a file using boost graph library.
#include <boost/graph/graphviz.hpp>
using namespace std;
using namespace boost;
int main(int,char*[])
{
typedef adjacency_list< vecS, vecS, undirectedS, property<vertex_color_t,int> > Graph;
Graph g(0);
dynamic_properties dp;
auto index = get(vertex_color, g);
dp.property("node_id", index);
ifstream fin("test.dot");
read_graphviz(fin, g, dp);
}
However, in this source code, I had to attach another property(vertex_color_t) to store "node_id". In my simple example, it is just the same as "node_index".
Is there a way that I can identify them to save memory?? I don't want to introduce additional property.