src/hugo/dimacs.h
changeset 782 df2e45e09652
parent 575 bdf7fb750e0e
child 784 a48964a87141
equal deleted inserted replaced
3:5bb65cb38835 4:86ecf40798e0
   170     typename Graph::template NodeMap<int> nodes(g);
   170     typename Graph::template NodeMap<int> nodes(g);
   171 
   171 
   172     os << "c matching problem" << std::endl;
   172     os << "c matching problem" << std::endl;
   173 
   173 
   174     int i=1;
   174     int i=1;
   175     NodeIt v;
   175     for(NodeIt v(g); v!=INVALID; ++v) {
   176     for(g.first(v); g.valid(v); g.next(v)) {
       
   177       nodes.set(v, i);
   176       nodes.set(v, i);
   178       ++i;
   177       ++i;
   179     }    
   178     }    
   180     
   179     
   181     os << "p mat " << g.nodeNum() << " " << g.edgeNum() << std::endl;
   180     os << "p mat " << g.nodeNum() << " " << g.edgeNum() << std::endl;
   182 
   181 
   183     EdgeIt e;
   182     for(EdgeIt e(g); e!=INVALID; ++e) {
   184     for(g.first(e); g.valid(e); g.next(e)) {
       
   185       os << "a " << nodes[g.tail(e)] << " " << nodes[g.head(e)] << std::endl; 
   183       os << "a " << nodes[g.tail(e)] << " " << nodes[g.head(e)] << std::endl; 
   186     }
   184     }
   187 
   185 
   188   }
   186   }
   189 
   187