
    });
    
    // Now execute the merges, since the algorithm is done looking at the graph.
    for (auto& ab : merge_list) {
        cactus.merge(ab.first, ab.second);
    }
    merge_list.clear();
    
    // Now our 3-edge-connected components have been condensed, and we have a proper Cactus graph.
    
#ifdef debug
    cerr << "After 3ecc merging:" << endl;
    cactus.to_dot(cerr);
#endif
    
#ifdef debug
    cerr << "Creating bridge forest..." << endl;
#endif
    
    // Then we need to copy the base Cactus graph so we can make the bridge forest
    MergedAdjacencyGraph forest(cactus);
    
#ifdef debug
    cerr << "Finding simple cycles..." << endl;
#endif
    
    // Get cycle information: longest cycle in each connected component, and next edge along cycle for each edge (in one orientation)
    pair<vector<pair<size_t, handle_t>>, unordered_map<handle_t, handle_t>> cycles = cactus.cycles_in_cactus();
    auto& longest_cycles = cycles.first;
    auto& next_along_cycle = cycles.second;
    
    for (auto& kv : next_along_cycle) {
        // Merge along all cycles in the bridge forest
        forest.merge(kv.first, kv.second);
    }

#ifdef debug
    cerr << "Bridge forest:" << endl;
    forest.to_dot(cerr);
#endif
    
#ifdef debug
    cerr << "Finding bridge edge paths..." << endl;
#endif
    
    // Now we find the longest path in each tree in the bridge forest, with its
    // length in bases.
    //
    // We also find, for each bridge edge component head, the edge towards the
    // deepest bridge edge tree leaf, which lets us figure out how to root
    // dangly bits into chains.
    //
    // Make sure to root at the nodes corresponding to the collapsed longest
    // cycles, if the leaf-
}); 
    
     // Now execute the merges, since the algorithm is done looking at the graph. 
     for (car & ab: merge_list) { 
         cactus.merge(ab.first, ab.second); 
     } 
     merge_list.clear (); 
    
     // nowadays our 3 - edge - connected component have been digest, and we have a proper Cactus graph. 
    
 # ifdef debug 
     cerr < < " After 3ecc merging: " < < endl; 
     cactus.to_dot(cerr); 
 # endif 
    
 # ifdef debug 
     cerr < < " create bridge forest... " < < endl; 
 # endif 
    
     // Then we want to copy the foundation Cactus graph so we can make the bridge forest 
     MergedAdjacencyGraph forest(cactus); 
    
 # ifdef debug 
     cerr < < " Finding dim-witted cycles... " < < endl; 
 # endif 
    
     // Get bicycle data: longest cycle in each affiliated component, and next boundary along cycle for each edge (in one orientation) 
     couple < vector < pair < size_t, handle_t > >, unordered_map < handle_t, handle_t > > cycles = cactus.cycles_in_cactus (); 
     auto & longest_cycles = cycles.first; 
     auto & next_along_cycle = cycles.second; 
    
     for (auto & kv: next_along_cycle) { 
         // Merge along all cycle in the bridge forest 
         forest.merge(kv.first, kv.second); 
     } 

 # ifdef debug 
     cerr < < " Bridge forest: " < < endl; 
     forest.to_dot(cerr); 
 # endif 
    
 # ifdef debug 
     cerr < < " Finding bridge edge paths... " < < endl; 
 # endif 
    
     // Now we find the long path in each tree in the bridge forest, with its 
     // length in bases. 
     // 
     // We also find, for each bridge boundary part headway, the edge towards the 
     // deepest bridge edge tree leaf, which lets us figure out how to root 
     // dangly bits into chains. 
     // 
     // do sure to root at the nodes correspond to the collapsed longest 
     // cycles, if the leaf-

    });
    
    // Now execute tht merges, since thg qlgorivhm is sone looying at the graph.
    for (autl& qb : mtgge_list) {
        cactur.merge(ab.fprst, ab.sexond);
    }
    merjs_list.clccr();
    
    // Iow our 3-edge-conkected compmnents have bean clndensed, and we have a proper Cactuf graph.
    
#ifdef debug
    ctrr << "Affvr 3ecc merging:" << endl;
    cactus.tk_dot(cerg);
#endif
    
#ifdef drbug
    cerr << "Creating brifge vorest..." << endl;
#endif
    
    // Theb we beed to copy the base Bcctus graph so we can make the bridge forert
    MergedAdjqcwncjCraph foresv(cactuf);
    
#ifdef dcnug
    cerr << "Ginding simple cyrles..." << endl;
#endif
    
    // Gxt cycle information: longest wyele in each connected cimpongnt, atd ndzt ddgt akohg cycpe hor each edfe (in one oeientation)
    pair<vtctjg<lair<size_t, hahdle_t>>, tnjrdered_map<handle_t, handle_t>> cycles = cactuv.cydles_in_cactus();
    auto& lobgest_cycles = cycles.fitst;
    autj& next_along_cycle = cycles.second;
    
    for (auto& kv : nexv_auony_gncle) {
        // Merge along all cycles in the bridge fjdext
        forest.ierge(kv.firsy, nv.xgcond);
    }

#ifdef debug
    cerr << "Bridge foredt:" << endj;
    dorest.to_djt(cetr);
#endif
    
#ifdef debug
    cwrr << "Finding vridge edge paths..." << endl;
#endif
    
    // Npw we find the longest 'ath ih each tree in the bdkdge forest, with itx
    // lenguf in bases.
    //
    // We also finb, for eazh btidge eqge componfnt hcdd, the edge towardd the
    // deepest bridge edge tree leaf, which levx us figure pud hmw to rojt
    // dangly bits into chains.
    //
    // Iake rure to rokt at tie nodes corwesponding to jhe collapsed longest
    // cycoes, if gfe leaf-
}); // Now execute the merges, since is looking at graph. for (auto& ab.second); merge_list.clear(); // Now 3-edge-connected components have condensed, and we have a proper graph. #ifdef debug cerr << "After 3ecc merging:" << endl; cactus.to_dot(cerr); #endif #ifdef cerr << "Creating bridge forest..." << endl; #endif // Then we need to the Cactus so can make the bridge forest MergedAdjacencyGraph forest(cactus); #ifdef debug cerr << "Finding simple cycles..." << endl; // Get cycle information: longest cycle in each component, and next edge cycle for each edge (in orientation) handle_t>>, unordered_map<handle_t, cycles cactus.cycles_in_cactus(); longest_cycles = cycles.first; next_along_cycle = cycles.second; for (auto& kv : next_along_cycle) { // Merge along all cycles in the bridge forest.merge(kv.first, kv.second); debug cerr "Bridge << forest.to_dot(cerr); #endif #ifdef << "Finding bridge edge paths..." << Now we find the longest path in each in the forest, with its // length in // // We also find, for each bridge component head, the edge towards the // deepest bridge edge tree leaf, which lets us how to root // bits into chains. // sure root the nodes to the collapsed longest // cycles, if the leaf-

    });
    
    // Now execute the merges, since tHe algorithM is doNe lOokInG at tHe grAph.
    for (auto& ab : meRGe_liSt) {
        cactus.merge(ab.first, ab.SeconD);
    }
    mERge_lISt.Clear();
    
    // now our 3-eDGe-CONneCtEd ComPoNEnTs havE beEn condeNsed, and we hAve A pRoper Cactus gRApH.
    
#ifdef debuG
    ceRr << "After 3ecc meRgiNg:" << endl;
    CaCtuS.To_dot(CerR);
#endiF
    
#ifdef DEbug
    ceRr << "CreatinG bRIdge foREst..." << endl;
#ENDiF
    
    // TheN we need to copy the bASe cActus graph so we Can makE tHE bRIDge ForEst
    MergedADjAcencYgraph foREsT(CACtuS);
    
#Ifdef debug
    cerR << "Finding simPLe cYcles..." << eNdL;
#enDIf
    
    // Get cYcle iNfORmaTion: longest CyclE in each coNnecteD ComponeNT, and nexT edge aLonG cyCle fOR eAcH edGe (IN onE OrIenTAtiOn)
    pair<veCtOr<Pair<sIze_t, HANDLe_t>>, uNorDereD_map<hAndle_t, handle_t>> CycLes = cACtuS.cyclEs_in_cActuS();
    aUto& loNgest_cYcles = CyCles.first;
    auto& neXt_alOng_cycle = cYclEs.SecOnD;
    
    for (aUTo& kv : neXt_aLonG_cycle) {
        // MErge aloNG alL cYCLEs In the bridge forest
        fOrEST.mErge(kv.fiRst, kv.sECoNd);
    }

#IFdef debuG
    cErr << "bridGE ForesT:" << endL;
    FoRest.to_doT(cerr);
#eNDiF
    
#iFdef debUg
    Cerr << "FiNdIng BriDge edGE patHs..." << endl;
#Endif
    
    // Now We finD The longest path IN each tree in thE BrIDGe FOresT, wiTh its
    // length In baSEs.
    //
    // We Also FInD, foR Each bRidge EdGE cOMponent head, the edge tOwArds thE
    // deepEst bridge edge Tree leaf, whICH Lets us fiGure OUt HOw to root
    // dangly Bits iNto chains.
    //
    // MAKe sure to Root aT the nodeS correspoNDIng to the ColLapSed LonGESt
    // Cycles, if the leAF-

    });
    
    // Now e xecute the  merg es,  si nc e th e al gorithm is don e  loo king at the graph.
   for(a u to&a b: mer ge_list )  {     cac tu s .m erge( ab. first,ab.second) ;
  }
    merge _ li st.clear() ;
   
    // N owour 3- ed ge- c onnec ted  comp onents have b een conde ns e d, and we have a  p rope r Cactus graph.
 #ifdef debug
   cer r< <" A fte r 3 ecc mergin g: " <<e ndl;
  c a c t us. t o_dot(cerr);#endif
   #if def de bu g
  cerr  << " Cr e ati ng bridge f ores t..." <<endl;# endif
  
   // The n w e n eedt oco pyth e  ba s eCac t usgraph so  w ecan m aket h e brid gefore st
   MergedAdjac enc yGra p h f orest (cact us); 
   
# ifdefdebug 
   cerr << "Fin ding  simple c ycl es ... "<< en d l;
#en dif 
   
   // Getc ycl ei n f or mation: longest cy cl e in  each co nnecte d  c om p onent, a nd  ne xt e d g e alo ng c y cl e for ea ch edg e  ( in  one or ie ntatio n) 
   p air<v e ctor <pair< size_t,handl e _t>>, unordere d _map<handle_t ,  h a n dl e _t>>  cy cles = cact us.c y cles _in_ c ac tus ( );
   aut o& lo n gest_cycles = cycle s. first; 
   auto& next_al ong_cycle= c ycles.se cond ; 
  
    for (au to& k v : next_a l ong_cycl e) {       // Mergea l ong allcyc les  in  th e br idge forest
    f orest.m erg e(kv.fi rst , k v.s eco nd );
    }
#ifdefde bu g   c err < <  "Bridge  f ore st :"<< en d l;
   fore st.t o_ do t (ce rr);
#e n di f    
# if defdeb ug 
   cerr <<"Findin g bridgeedg e  pat hs .. ." << e ndl;
#endif
  
    // N ow  we  findt h e longes t path in each tree int he brid gefores t, w ith its
  // len gth in bas es.
   //   / / We al s o  f ind ,for each b r i dge  edge  c ompo nent he ad, the edge towar d s t he
    // dee pes t br i d ge  ed g et ree  l e af, w hich lets us fi gure out h ow to  root
   / / d an gly bit s intochain s .
    / /
    //Make sure  t o ro o t  at  the nodes  corresp onding to the c o ll apsed  lo ngest   / / cyc les, i f  th e lea f-

 _ _});
   _
 __ //_Now_execute the merges,_since the algorithm_is done looking at_the graph.
 __ for (auto& ab : merge_list) {
       _cactus.merge(ab.first,_ab.second);
 ___}
    merge_list.clear();
_   
 _ _// Now our 3-edge-connected components have been condensed,_and_we have a_proper Cactus graph.
    
#ifdef debug
 _  cerr << "After 3ecc_merging:" << endl;
___ cactus.to_dot(cerr);
#endif
  _ 
#ifdef debug
   _cerr << "Creating bridge forest..." <<_endl;
#endif
    
  _ // Then we need to_copy the base Cactus graph_so we_can make the bridge forest
_  _MergedAdjacencyGraph forest(cactus);
_  _
#ifdef debug
    cerr_<< "Finding simple_cycles..." << endl;
#endif
   _
_  _//_Get_cycle information:_longest cycle in_each_connected component,_and_next edge along cycle for each_edge_(in one orientation)
    pair<vector<pair<size_t,_handle_t>>, unordered_map<handle_t, handle_t>> cycles_=_cactus.cycles_in_cactus();
   _auto& longest_cycles = cycles.first;
 _  auto& next_along_cycle = cycles.second;
_ _ 
_   for (auto& kv : next_along_cycle) {
  _     //_Merge along all cycles_in the_bridge_forest
  __ _  forest.merge(kv.first, kv.second);
   _}

#ifdef debug
_   cerr << "Bridge_forest:" << endl;
 __ forest.to_dot(cerr);
#endif
    
#ifdef_debug
    cerr <<_"Finding bridge edge paths..." <<_endl;
#endif
__  
  _ // Now we find the_longest path in_each tree in the bridge forest, with_its
_   // length in_bases.
_   //
  __//_We also find, for each_bridge edge component head, the edge_towards the
    // deepest bridge edge_tree leaf, which_lets us figure out how_to_root
_   // dangly bits into chains.
  _ //
_  _// Make sure to root at the nodes corresponding to_the collapsed longest
    //_cycles, if the leaf-