129 const std::vector<dom_int> &B = this->m_bsgs.B;
130 std::vector<TRANS > &U = this->m_bsgs.U;
132 PERMLIB_DEBUG(std::cout <<
"starting with " << g <<
" @ " << level << std::endl;)
133 ++this->m_statNodesVisited;
135 if (level == B.size() || this->checkLeaf(level)) {
136 PERMLIB_DEBUG(std::cout <<
"limit reached for " << g <<
" // " << (*this->m_pred)(g) << std::endl;)
137 return this->processLeaf(g, level, level, completed, groupK, groupL);
141 std::vector<unsigned long> orbit(U[level].begin(), U[level].end());
142 BOOST_FOREACH(
unsigned long &alpha, orbit) {
145 std::sort(orbit.begin(), orbit.end(), *this->m_sorter);
146 unsigned int s = orbit.size();
148 std::vector<unsigned long>::const_iterator orbIt;
149 for (orbIt = orbit.begin(); orbIt != orbit.end(); ++orbIt) {
150 if (s < groupK.
U[level].size()) {
151 PERMLIB_DEBUG(std::cout <<
"PRUNE the rest: s=" << s <<
" < " << groupK.
U[level].size() << std::endl;)
152 this->m_statNodesPrunedCosetMinimality += s;
158 unsigned long beta = g % *orbIt;
159 PERMLIB_DEBUG(std::cout <<
" BETA = " << beta <<
" <-- " << B[level] << std::endl;)
160 boost::scoped_ptr<PERM> u_beta_ptr(U[level].at(beta));
163 if (!this->m_pred->childRestriction(*u_beta_ptr, level, B[level])) {
164 ++this->m_statNodesPrunedChildRestriction;
165 if (m_breakAfterChildRestriction)
169 if (this->m_pruningLevelDCM && this->pruneDCM(*u_beta_ptr, level, groupK, groupL)) {
170 ++this->m_statNodesPrunedCosetMinimality2;
174 unsigned int ret = search(*u_beta_ptr, level+1, completed, groupK, groupL);
178 PERMLIB_DEBUG(std::cout <<
"^^ MULTI BACKTRACK! leave " << level <<
" to " << ret << std::endl;)
182 completed = std::min(completed, level);
static std::vector< unsigned long > createOrder(unsigned int size, InputIterator begin, InputIterator end)
constructs an ordering array with the same parameters as BaseSorter for use with BaseSorterByReferenc...
Definition base_sorter.h:121
BacktrackSearch(const BSGSIN &bsgs, unsigned int pruningLevelDCM, bool breakAfterChildRestriction=false, bool stopAfterFirstElement=false)
constructor
Definition backtrack_search.h:90