tools/lgf-gen.cc
changeset 624 1f631044c290
parent 616 f2d6d3446adf
child 654 a312f84d86c6
equal deleted inserted replaced
5:9bab1296175b 6:4bd5c9c2350b
   478     {
   478     {
   479       Node a=g.u(*ei);
   479       Node a=g.u(*ei);
   480       Node b=g.v(*ei);
   480       Node b=g.v(*ei);
   481       g.erase(*ei);
   481       g.erase(*ei);
   482       ConstMap<Arc,int> cegy(1);
   482       ConstMap<Arc,int> cegy(1);
   483       Suurballe<ListGraph,ConstMap<Arc,int> > sur(g,cegy,a,b);
   483       Suurballe<ListGraph,ConstMap<Arc,int> > sur(g,cegy);
   484       int k=sur.run(2);
   484       int k=sur.run(a,b,2);
   485       if(k<2 || sur.totalLength()>d)
   485       if(k<2 || sur.totalLength()>d)
   486         g.addEdge(a,b);
   486         g.addEdge(a,b);
   487       else cnt++;
   487       else cnt++;
   488 //       else std::cout << "Remove arc " << g.id(a) << "-" << g.id(b) << '\n';
   488 //       else std::cout << "Remove arc " << g.id(a) << "-" << g.id(b) << '\n';
   489     }
   489     }
   509       EdgeIt e(g);
   509       EdgeIt e(g);
   510       for(;e!=INVALID && !cross(e,li);++e) ;
   510       for(;e!=INVALID && !cross(e,li);++e) ;
   511       Edge ne;
   511       Edge ne;
   512       if(e==INVALID) {
   512       if(e==INVALID) {
   513         ConstMap<Arc,int> cegy(1);
   513         ConstMap<Arc,int> cegy(1);
   514         Suurballe<ListGraph,ConstMap<Arc,int> >
   514         Suurballe<ListGraph,ConstMap<Arc,int> > sur(g,cegy);
   515           sur(g,cegy,pi->a,pi->b);
   515         int k=sur.run(pi->a,pi->b,2);
   516         int k=sur.run(2);
       
   517         if(k<2 || sur.totalLength()>d)
   516         if(k<2 || sur.totalLength()>d)
   518           {
   517           {
   519             ne=g.addEdge(pi->a,pi->b);
   518             ne=g.addEdge(pi->a,pi->b);
   520             arcs.push_back(ne);
   519             arcs.push_back(ne);
   521             cnt++;
   520             cnt++;