COIN-OR::LEMON - Graph Library

Ticket #597: 597-3-b9fad0f9f8ab-rename-fields.patch

File 597-3-b9fad0f9f8ab-rename-fields.patch, 20.7 KB (added by Peter Kovacs, 7 years ago)
  • lemon/vf2.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1507383956 -7200
    # Node ID b9fad0f9f8ab31b73eb9179793d72c0aa15c7406
    # Parent  76349d8212d3953003885aabcef528a29de3d42d
    Unify naming scheme of fields in Vf2 and Vf2pp (#597)
    
    diff --git a/lemon/vf2.h b/lemon/vf2.h
    a b  
    112112           class NEQ = bits::vf2::AlwaysEq >
    113113#endif
    114114  class Vf2 {
    115     //Current depth in the DFS tree.
    116     int _depth;
    117 
    118     //Functor with bool operator()(G1::Node,G2::Node), which returns 1
    119     //if and only if the two nodes are equivalent
    120     NEQ _nEq;
    121 
    122     //_conn[v2] = number of covered neighbours of v2
    123     typename G2::template NodeMap<int> _conn;
    124 
    125     //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2,
    126     //where v1 is a node of G1 and v2 is a node of G2
    127     M &_mapping;
    128 
    129     //order[i] is the node of g1 for which a pair is searched if depth=i
    130     std::vector<typename G1::Node> order;
    131 
    132     //currEdgeIts[i] is the last used edge iterator in the i-th
    133     //depth to find a pair for node order[i]
    134     std::vector<typename G2::IncEdgeIt> currEdgeIts;
    135  
    136115    //The graph to be embedded
    137116    const G1 &_g1;
    138117
    139118    //The graph into which g1 is to be embedded
    140119    const G2 &_g2;
    141120
     121    //Functor with bool operator()(G1::Node,G2::Node), which returns 1
     122    //if and only if the two nodes are equivalent
     123    NEQ _nEq;
     124
     125    //Current depth in the DFS tree.
     126    int _depth;
     127
     128    //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2,
     129    //where v1 is a node of G1 and v2 is a node of G2
     130    M &_mapping;
     131
     132    //_order[i] is the node of g1 for which a pair is searched if depth=i
     133    std::vector<typename G1::Node> _order;
     134 
     135    //_conn[v2] = number of covered neighbours of v2
     136    typename G2::template NodeMap<int> _conn;
     137
     138    //_currEdgeIts[i] is the last used edge iterator in the i-th
     139    //depth to find a pair for node _order[i]
     140    std::vector<typename G2::IncEdgeIt> _currEdgeIts;
     141
    142142    //lookup tables for cutting the searchtree
    143     typename G1::template NodeMap<int> rNew1t,rInOut1t;
     143    typename G1::template NodeMap<int> _rNew1t, _rInOut1t;
    144144
    145145    MappingType _mapping_type;
    146146
     
    159159      }
    160160      switch(MT) {
    161161      case INDUCED:
    162         return rInOut1t[n1]<=rInOut2&&rNew1t[n1]<=rNew2;
     162        return _rInOut1t[n1]<=rInOut2&&_rNew1t[n1]<=rNew2;
    163163      case SUBGRAPH:
    164         return rInOut1t[n1]<=rInOut2;
     164        return _rInOut1t[n1]<=rInOut2;
    165165      case ISOMORPH:
    166         return rInOut1t[n1]==rInOut2&&rNew1t[n1]==rNew2;
     166        return _rInOut1t[n1]==rInOut2&&_rNew1t[n1]==rNew2;
    167167      default:
    168168        return false;
    169169      }
     
    235235    void setOrder() {
    236236      // we will find pairs for the nodes of g1 in this order
    237237
    238       // bits::vf2::DfsLeaveOrder<G1> v(_g1,order);
     238      // bits::vf2::DfsLeaveOrder<G1> v(_g1,_order);
    239239      //   DfsVisit<G1,bits::vf2::DfsLeaveOrder<G1> >dfs(_g1, v);
    240240      //   dfs.run();
    241241
    242242      //it is more efficient in practice than DFS
    243       bits::vf2::BfsLeaveOrder<G1> v(_g1,order);
     243      bits::vf2::BfsLeaveOrder<G1> v(_g1,_order);
    244244      BfsVisit<G1,bits::vf2::BfsLeaveOrder<G1> >bfs(_g1, v);
    245245      bfs.run();
    246246    }
     
    248248    template<MappingType MT>
    249249    bool extMatch() {
    250250      while(_depth>=0) {
    251         if(_depth==static_cast<int>(order.size())) {
     251        if(_depth==static_cast<int>(_order.size())) {
    252252          //all nodes of g1 are mapped to nodes of g2
    253253          --_depth;
    254254          return true;
    255255        }
    256         typename G1::Node& nodeOfDepth = order[_depth];
     256        typename G1::Node& nodeOfDepth = _order[_depth];
    257257        const typename G2::Node& pairOfNodeOfDepth = _mapping[nodeOfDepth];
    258         typename G2::IncEdgeIt &edgeItOfDepth = currEdgeIts[_depth];
     258        typename G2::IncEdgeIt &edgeItOfDepth = _currEdgeIts[_depth];
    259259        //the node of g2 whose neighbours are the candidates for
    260260        //the pair of nodeOfDepth
    261261        typename G2::Node currPNode;
     
    326326    //calculate the lookup table for cutting the search tree
    327327    void setRNew1tRInOut1t() {
    328328      typename G1::template NodeMap<int> tmp(_g1,0);
    329       for(unsigned int i=0; i<order.size(); ++i) {
    330         const typename G1::Node& orderI = order[i];
     329      for(unsigned int i=0; i<_order.size(); ++i) {
     330        const typename G1::Node& orderI = _order[i];
    331331        tmp[orderI]=-1;
    332332        for(typename G1::IncEdgeIt e1(_g1,orderI); e1!=INVALID; ++e1) {
    333333          const typename G1::Node currNode=_g1.oppositeNode(orderI,e1);
    334334          if(tmp[currNode]>0)
    335             ++rInOut1t[orderI];
     335            ++_rInOut1t[orderI];
    336336          else if(tmp[currNode]==0)
    337             ++rNew1t[orderI];
     337            ++_rNew1t[orderI];
    338338        }
    339339        for(typename G1::IncEdgeIt e1(_g1,orderI); e1!=INVALID; ++e1) {
    340340          const typename G1::Node currNode=_g1.oppositeNode(orderI,e1);
     
    355355    ///\param neq A bool-valued binary functor determining whether a node is
    356356    ///mappable to another. By default it is an always true operator.
    357357    Vf2(const G1 &g1, const G2 &g2, M &m, const NEQ &neq = NEQ() ) :
    358       _nEq(neq), _conn(g2,0), _mapping(m), order(countNodes(g1)),
    359       currEdgeIts(countNodes(g1),INVALID), _g1(g1), _g2(g2), rNew1t(g1,0),
    360       rInOut1t(g1,0), _mapping_type(SUBGRAPH), _deallocMappingAfterUse(0)
     358      _g1(g1), _g2(g2), _nEq(neq), _depth(0), _mapping(m),
     359      _order(countNodes(g1)), _conn(g2,0),
     360      _currEdgeIts(countNodes(g1),INVALID), _rNew1t(g1,0), _rInOut1t(g1,0),
     361      _mapping_type(SUBGRAPH), _deallocMappingAfterUse(0)
    361362    {
    362       _depth=0;
    363363      setOrder();
    364364      setRNew1tRInOut1t();
    365365      for(typename G1::NodeIt n(g1);n!=INVALID;++n)
  • lemon/vf2pp.h

    diff --git a/lemon/vf2pp.h b/lemon/vf2pp.h
    a b  
    2828#include <lemon/bfs.h>
    2929#include <lemon/bits/vf2_internals.h>
    3030
    31 
    3231#include <vector>
    3332#include <algorithm>
    3433#include <utility>
    3534
    36 
    3735namespace lemon {
    3836  namespace bits {
    3937    namespace vf2pp {
     
    10199           class M2 = typename G2::template NodeMap<int> >
    102100#endif
    103101  class Vf2pp {
    104     //Current depth in the search tree.
    105     int _depth;
    106 
    107     //_conn[v2] = number of covered neighbours of v2
    108     typename G2::template NodeMap<int> _conn;
    109 
    110     //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2,
    111     //where v1 is a node of G1 and v2 is a node of G2
    112     M &_mapping;
    113 
    114     //order[i] is a node of g1 for which a pair is searched if depth=i
    115     std::vector<typename G1::Node> order;
    116 
    117     //currEdgeIts[i] is the last used edge iterator in the i-th
    118     //depth to find a pair for node order[i]
    119     std::vector<typename G2::IncEdgeIt> currEdgeIts;
    120  
    121102    //The graph to be embedded
    122103    const G1 &_g1;
    123104
    124105    //The graph into which g1 is to be embedded
    125106    const G2 &_g2;
    126107
    127     //rNewLabels1[v] is a pair of form
     108    //Current depth in the search tree.
     109    int _depth;
     110
     111    //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2,
     112    //where v1 is a node of G1 and v2 is a node of G2
     113    M &_mapping;
     114
     115    //_order[i] is a node of g1 for which a pair is searched if depth=i
     116    std::vector<typename G1::Node> _order;
     117
     118    //_conn[v2] = number of covered neighbours of v2
     119    typename G2::template NodeMap<int> _conn;
     120
     121    //_currEdgeIts[i] is the last used edge iterator in the i-th
     122    //depth to find a pair for node _order[i]
     123    std::vector<typename G2::IncEdgeIt> _currEdgeIts;
     124 
     125    //_rNewLabels1[v] is a pair of form
    128126    //(label; num. of uncov. nodes with such label and no covered neighbours)
    129127    typename G1::template NodeMap<std::vector<std::pair<int,int> > >
    130     rNewLabels1;
     128    _rNewLabels1;
    131129
    132     //rInOutLabels1[v] is the number of covered neighbours of v for each label
     130    //_rInOutLabels1[v] is the number of covered neighbours of v for each label
    133131    //in form (label,number of such labels)
    134132    typename G1::template NodeMap<std::vector<std::pair<int,int> > >
    135     rInOutLabels1;
     133    _rInOutLabels1;
    136134
    137135    //_intLabels1[v]==i means that node v has label i in _g1
    138136    //(i is in {0,1,2,..,K-1}, where K is the number of diff. labels)
     
    143141    M2 &_intLabels2;
    144142
    145143    //largest label
    146     const int maxLabel;
     144    const int _maxLabel;
    147145
    148146    //lookup tables for manipulating with label class cardinalities
    149147    //(after use they have to be reset to 0..0)
    150     std::vector<int> labelTmp1,labelTmp2;
     148    std::vector<int> _labelTmp1,_labelTmp2;
    151149
    152150    MappingType _mapping_type;
    153151
     
    161159      for(typename G2::IncEdgeIt e2(_g2,n2); e2!=INVALID; ++e2) {
    162160        const typename G2::Node currNode=_g2.oppositeNode(n2,e2);
    163161        if(_conn[currNode]>0)
    164           --labelTmp1[_intLabels2[currNode]];
     162          --_labelTmp1[_intLabels2[currNode]];
    165163        else if(MT!=SUBGRAPH&&_conn[currNode]==0)
    166           --labelTmp2[_intLabels2[currNode]];
     164          --_labelTmp2[_intLabels2[currNode]];
    167165      }
    168166
    169167      bool ret=1;
    170168      if(ret) {
    171         for(unsigned int i = 0; i < rInOutLabels1[n1].size(); ++i)
    172           labelTmp1[rInOutLabels1[n1][i].first]+=rInOutLabels1[n1][i].second;
     169        for(unsigned int i = 0; i < _rInOutLabels1[n1].size(); ++i)
     170          _labelTmp1[_rInOutLabels1[n1][i].first]+=_rInOutLabels1[n1][i].second;
    173171
    174172        if(MT!=SUBGRAPH)
    175           for(unsigned int i = 0; i < rNewLabels1[n1].size(); ++i)
    176             labelTmp2[rNewLabels1[n1][i].first]+=rNewLabels1[n1][i].second;
     173          for(unsigned int i = 0; i < _rNewLabels1[n1].size(); ++i)
     174            _labelTmp2[_rNewLabels1[n1][i].first]+=_rNewLabels1[n1][i].second;
    177175
    178176        switch(MT) {
    179177        case INDUCED:
    180           for(unsigned int i = 0; i < rInOutLabels1[n1].size(); ++i)
    181             if(labelTmp1[rInOutLabels1[n1][i].first]>0) {
     178          for(unsigned int i = 0; i < _rInOutLabels1[n1].size(); ++i)
     179            if(_labelTmp1[_rInOutLabels1[n1][i].first]>0) {
    182180              ret=0;
    183181              break;
    184182            }
    185183          if(ret)
    186             for(unsigned int i = 0; i < rNewLabels1[n1].size(); ++i)
    187               if(labelTmp2[rNewLabels1[n1][i].first]>0) {
     184            for(unsigned int i = 0; i < _rNewLabels1[n1].size(); ++i)
     185              if(_labelTmp2[_rNewLabels1[n1][i].first]>0) {
    188186                ret=0;
    189187                break;
    190188              }
    191189          break;
    192190        case SUBGRAPH:
    193           for(unsigned int i = 0; i < rInOutLabels1[n1].size(); ++i)
    194             if(labelTmp1[rInOutLabels1[n1][i].first]>0) {
     191          for(unsigned int i = 0; i < _rInOutLabels1[n1].size(); ++i)
     192            if(_labelTmp1[_rInOutLabels1[n1][i].first]>0) {
    195193              ret=0;
    196194              break;
    197195            }
    198196          break;
    199197        case ISOMORPH:
    200           for(unsigned int i = 0; i < rInOutLabels1[n1].size(); ++i)
    201             if(labelTmp1[rInOutLabels1[n1][i].first]!=0) {
     198          for(unsigned int i = 0; i < _rInOutLabels1[n1].size(); ++i)
     199            if(_labelTmp1[_rInOutLabels1[n1][i].first]!=0) {
    202200              ret=0;
    203201              break;
    204202            }
    205203          if(ret)
    206             for(unsigned int i = 0; i < rNewLabels1[n1].size(); ++i)
    207               if(labelTmp2[rNewLabels1[n1][i].first]!=0) {
     204            for(unsigned int i = 0; i < _rNewLabels1[n1].size(); ++i)
     205              if(_labelTmp2[_rNewLabels1[n1][i].first]!=0) {
    208206                ret=0;
    209207                break;
    210208              }
     
    212210        default:
    213211          return false;
    214212        }
    215         for(unsigned int i = 0; i < rInOutLabels1[n1].size(); ++i)
    216           labelTmp1[rInOutLabels1[n1][i].first]=0;
     213        for(unsigned int i = 0; i < _rInOutLabels1[n1].size(); ++i)
     214          _labelTmp1[_rInOutLabels1[n1][i].first]=0;
    217215
    218216        if(MT!=SUBGRAPH)
    219           for(unsigned int i = 0; i < rNewLabels1[n1].size(); ++i)
    220             labelTmp2[rNewLabels1[n1][i].first]=0;
     217          for(unsigned int i = 0; i < _rNewLabels1[n1].size(); ++i)
     218            _labelTmp2[_rNewLabels1[n1][i].first]=0;
    221219      }
    222220
    223221      for(typename G2::IncEdgeIt e2(_g2,n2); e2!=INVALID; ++e2) {
    224222        const typename G2::Node currNode=_g2.oppositeNode(n2,e2);
    225         labelTmp1[_intLabels2[currNode]]=0;
     223        _labelTmp1[_intLabels2[currNode]]=0;
    226224        if(MT!=SUBGRAPH&&_conn[currNode]==0)
    227           labelTmp2[_intLabels2[currNode]]=0;
     225          _labelTmp2[_intLabels2[currNode]]=0;
    228226      }
    229227
    230228      return ret;
     
    310308    void processBFSLevel(typename G1::Node source,unsigned int& orderIndex,
    311309                         typename G1::template NodeMap<int>& dm1,
    312310                         typename G1::template NodeMap<bool>& added) {
    313       order[orderIndex]=source;
     311      _order[orderIndex]=source;
    314312      added[source]=1;
    315313
    316314      unsigned int endPosOfLevel=orderIndex,
     
    320318      typename G1::template NodeMap<int> currConn(_g1,0);
    321319
    322320      while(orderIndex<=lastAdded){
    323         typename G1::Node currNode = order[orderIndex];
     321        typename G1::Node currNode = _order[orderIndex];
    324322        for(typename G1::IncEdgeIt e(_g1,currNode); e!=INVALID; ++e) {
    325323          typename G1::Node n = _g1.oppositeNode(currNode,e);
    326324          if(!added[n]) {
    327             order[++lastAdded]=n;
     325            _order[++lastAdded]=n;
    328326            added[n]=1;
    329327          }
    330328        }
     
    332330          for(unsigned int j = startPosOfLevel; j <= endPosOfLevel; ++j) {
    333331            int minInd=j;
    334332            for(unsigned int i = j+1; i <= endPosOfLevel; ++i)
    335               if(currConn[order[i]]>currConn[order[minInd]]||
    336                  (currConn[order[i]]==currConn[order[minInd]]&&
    337                   (dm1[order[i]]>dm1[order[minInd]]||
    338                    (dm1[order[i]]==dm1[order[minInd]]&&
    339                     labelTmp1[_intLabels1[order[minInd]]]>
    340                     labelTmp1[_intLabels1[order[i]]]))))
     333              if(currConn[_order[i]]>currConn[_order[minInd]]||
     334                 (currConn[_order[i]]==currConn[_order[minInd]]&&
     335                  (dm1[_order[i]]>dm1[_order[minInd]]||
     336                   (dm1[_order[i]]==dm1[_order[minInd]]&&
     337                    _labelTmp1[_intLabels1[_order[minInd]]]>
     338                    _labelTmp1[_intLabels1[_order[i]]]))))
    341339                minInd=i;
    342340
    343             --labelTmp1[_intLabels1[order[minInd]]];
    344             for(typename G1::IncEdgeIt e(_g1,order[minInd]); e!=INVALID; ++e)
    345               ++currConn[_g1.oppositeNode(order[minInd],e)];
    346             std::swap(order[j],order[minInd]);
     341            --_labelTmp1[_intLabels1[_order[minInd]]];
     342            for(typename G1::IncEdgeIt e(_g1,_order[minInd]); e!=INVALID; ++e)
     343              ++currConn[_g1.oppositeNode(_order[minInd],e)];
     344            std::swap(_order[j],_order[minInd]);
    347345          }
    348346          startPosOfLevel=endPosOfLevel+1;
    349347          endPosOfLevel=lastAdded;
     
    356354    //we will find pairs for the nodes of g1 in this order
    357355    void setOrder(){
    358356      for(typename G2::NodeIt n2(_g2); n2!=INVALID; ++n2)
    359         ++labelTmp1[_intLabels2[n2]];
     357        ++_labelTmp1[_intLabels2[n2]];
    360358
    361359      typename G1::template NodeMap<int> dm1(_g1,0);
    362360      for(typename G1::EdgeIt e(_g1); e!=INVALID; ++e) {
     
    372370          typename G1::Node minNode = n;
    373371          for(typename G1::NodeIt n1(_g1,minNode); n1!=INVALID; ++n1)
    374372            if(!added[n1] &&
    375                (labelTmp1[_intLabels1[minNode]]>
    376                 labelTmp1[_intLabels1[n1]]||(dm1[minNode]<dm1[n1]&&
    377                                              labelTmp1[_intLabels1[minNode]]==
    378                                              labelTmp1[_intLabels1[n1]])))
     373               (_labelTmp1[_intLabels1[minNode]]>
     374                _labelTmp1[_intLabels1[n1]]||(dm1[minNode]<dm1[n1]&&
     375                                             _labelTmp1[_intLabels1[minNode]]==
     376                                             _labelTmp1[_intLabels1[n1]])))
    379377              minNode=n1;
    380378          processBFSLevel(minNode,orderIndex,dm1,added);
    381379        }
    382380        else
    383381          ++n;
    384382      }
    385       for(unsigned int i = 0; i < labelTmp1.size(); ++i)
    386         labelTmp1[i]=0;
     383      for(unsigned int i = 0; i < _labelTmp1.size(); ++i)
     384        _labelTmp1[i]=0;
    387385    }
    388386
    389387
    390388    template<MappingType MT>
    391389    bool extMatch(){
    392390      while(_depth>=0) {
    393         if(_depth==static_cast<int>(order.size())) {
     391        if(_depth==static_cast<int>(_order.size())) {
    394392          //all nodes of g1 are mapped to nodes of g2
    395393          --_depth;
    396394          return true;
    397395        }
    398         typename G1::Node& nodeOfDepth = order[_depth];
     396        typename G1::Node& nodeOfDepth = _order[_depth];
    399397        const typename G2::Node& pairOfNodeOfDepth = _mapping[nodeOfDepth];
    400         typename G2::IncEdgeIt &edgeItOfDepth = currEdgeIts[_depth];
     398        typename G2::IncEdgeIt &edgeItOfDepth = _currEdgeIts[_depth];
    401399        //the node of g2 whose neighbours are the candidates for
    402         //the pair of order[_depth]
     400        //the pair of _order[_depth]
    403401        typename G2::Node currPNode;
    404402        if(edgeItOfDepth==INVALID){
    405403          typename G1::IncEdgeIt fstMatchedE(_g1,nodeOfDepth);
    406           //if _mapping[order[_depth]]!=INVALID, we don't need fstMatchedE
     404          //if _mapping[_order[_depth]]!=INVALID, we don't need fstMatchedE
    407405          if(pairOfNodeOfDepth==INVALID) {
    408406            for(; fstMatchedE!=INVALID &&
    409407                  _mapping[_g1.oppositeNode(nodeOfDepth,
     
    468466    //calculate the lookup table for cutting the search tree
    469467    void setRNew1tRInOut1t(){
    470468      typename G1::template NodeMap<int> tmp(_g1,0);
    471       for(unsigned int i=0; i<order.size(); ++i) {
    472         tmp[order[i]]=-1;
    473         for(typename G1::IncEdgeIt e1(_g1,order[i]); e1!=INVALID; ++e1) {
    474           const typename G1::Node currNode=_g1.oppositeNode(order[i],e1);
     469      for(unsigned int i=0; i<_order.size(); ++i) {
     470        tmp[_order[i]]=-1;
     471        for(typename G1::IncEdgeIt e1(_g1,_order[i]); e1!=INVALID; ++e1) {
     472          const typename G1::Node currNode=_g1.oppositeNode(_order[i],e1);
    475473          if(tmp[currNode]>0)
    476             ++labelTmp1[_intLabels1[currNode]];
     474            ++_labelTmp1[_intLabels1[currNode]];
    477475          else if(tmp[currNode]==0)
    478             ++labelTmp2[_intLabels1[currNode]];
     476            ++_labelTmp2[_intLabels1[currNode]];
    479477        }
    480         //labelTmp1[i]=number of neightbours with label i in set rInOut
    481         //labelTmp2[i]=number of neightbours with label i in set rNew
    482         for(typename G1::IncEdgeIt e1(_g1,order[i]); e1!=INVALID; ++e1) {
    483           const int& currIntLabel = _intLabels1[_g1.oppositeNode(order[i],e1)];
    484           if(labelTmp1[currIntLabel]>0) {
    485             rInOutLabels1[order[i]]
     478        //_labelTmp1[i]=number of neightbours with label i in set rInOut
     479        //_labelTmp2[i]=number of neightbours with label i in set rNew
     480        for(typename G1::IncEdgeIt e1(_g1,_order[i]); e1!=INVALID; ++e1) {
     481          const int& currIntLabel = _intLabels1[_g1.oppositeNode(_order[i],e1)];
     482          if(_labelTmp1[currIntLabel]>0) {
     483            _rInOutLabels1[_order[i]]
    486484              .push_back(std::make_pair(currIntLabel,
    487                                         labelTmp1[currIntLabel]));
    488             labelTmp1[currIntLabel]=0;
     485                                        _labelTmp1[currIntLabel]));
     486            _labelTmp1[currIntLabel]=0;
    489487          }
    490           else if(labelTmp2[currIntLabel]>0) {
    491             rNewLabels1[order[i]].
    492               push_back(std::make_pair(currIntLabel,labelTmp2[currIntLabel]));
    493             labelTmp2[currIntLabel]=0;
     488          else if(_labelTmp2[currIntLabel]>0) {
     489            _rNewLabels1[_order[i]].
     490              push_back(std::make_pair(currIntLabel,_labelTmp2[currIntLabel]));
     491            _labelTmp2[currIntLabel]=0;
    494492          }
    495493        }
    496494
    497         for(typename G1::IncEdgeIt e1(_g1,order[i]); e1!=INVALID; ++e1) {
    498           int& tmpCurrNode=tmp[_g1.oppositeNode(order[i],e1)];
     495        for(typename G1::IncEdgeIt e1(_g1,_order[i]); e1!=INVALID; ++e1) {
     496          int& tmpCurrNode=tmp[_g1.oppositeNode(_order[i],e1)];
    499497          if(tmpCurrNode!=-1)
    500498            ++tmpCurrNode;
    501499        }
     
    532530    ///The labels must be the numbers {0,1,2,..,K-1}, where K is the number of
    533531    ///different labels.
    534532    Vf2pp(const G1 &g1, const G2 &g2,M &m, M1 &intLabels1, M2 &intLabels2) :
    535       _depth(0), _conn(g2,0), _mapping(m), order(countNodes(g1),INVALID),
    536       currEdgeIts(countNodes(g1),INVALID), _g1(g1), _g2(g2), rNewLabels1(_g1),
    537       rInOutLabels1(_g1), _intLabels1(intLabels1) ,_intLabels2(intLabels2),
    538       maxLabel(getMaxLabel()), labelTmp1(maxLabel+1),labelTmp2(maxLabel+1),
     533      _g1(g1), _g2(g2), _depth(0), _mapping(m), _order(countNodes(g1),INVALID),
     534      _conn(g2,0), _currEdgeIts(countNodes(g1),INVALID), _rNewLabels1(_g1),
     535      _rInOutLabels1(_g1), _intLabels1(intLabels1) ,_intLabels2(intLabels2),
     536      _maxLabel(getMaxLabel()), _labelTmp1(_maxLabel+1),_labelTmp2(_maxLabel+1),
    539537      _mapping_type(SUBGRAPH), _deallocMappingAfterUse(0),
    540538      _deallocLabelsAfterUse(0)
    541539    {