8 #ifndef BOOST_GRAPH_WRITE_DIMACS_GRAPH_HPP
9 #define BOOST_GRAPH_WRITE_DIMACS_GRAPH_HPP
13 #include "utils/graph_typedefs.hpp"
21 void write_dimacs_graph(std::ostream& out,
const Instance& I){
23 const RawScaffoldGraph& g = I.get_graph();
24 out <<
"p edge "<<boost::num_vertices(g)<<
" "<<boost::num_edges(g)<<std::endl;
27 for(ScafVIterRange ur = boost::vertices(g); ur.first != ur.second; ++ur.first){
28 const ScafVertex& u = *ur.first;
29 const size_t u_idx = g[u].index;
30 for(ScafAdjIterRange vr = boost::adjacent_vertices(u, g); vr.first != vr.second; ++vr.first){
32 const ScafVertex& v = *vr.first;
33 const size_t v_idx = g[v].index;
36 out <<
"e "<<v_idx + 1<<
" "<<u_idx+1<<std::endl;
Definition: read_adj_list.hpp:22
Definition: read_phytree.hpp:10