Released under the GNU Lesser General Public License version 3. diff -Nur bliss-0.73/graph.cc bliss-0.73p/graph.cc --- bliss-0.73/graph.cc 2015-09-01 10:23:10.000000000 +0200 +++ bliss-0.73p/graph.cc 2017-12-21 14:36:32.068702372 +0100 @@ -67,6 +67,9 @@ report_hook = 0; report_user_param = 0; + + limit_search_nodes = 0; + limit_generators = 0; } @@ -609,13 +612,7 @@ - -typedef struct { - unsigned int splitting_element; - unsigned int certificate_index; - unsigned int subcertificate_length; - UintSeqHash eqref_hash; -} PathInfo; +// struct PathInfo moved to graph.hh by Thomas Rehn, 2011-07-12 void @@ -745,7 +742,7 @@ initialize_certificate(); std::vector search_stack; - std::vector first_path_info; + // first_path_info moved to graph.hh by Thomas Rehn, 2011-07-12 std::vector best_path_info; search_stack.clear(); @@ -1054,6 +1051,8 @@ const unsigned int child_level = current_level+1; /* Update some statistics */ stats.nof_nodes++; + if (limit_search_nodes && stats.nof_nodes >= limit_search_nodes) + break; if(search_stack.size() > stats.max_level) stats.max_level = search_stack.size(); @@ -1642,6 +1641,8 @@ best_path_automorphism); /* Update statistics */ stats.nof_generators++; + if (limit_generators && stats.nof_generators >= limit_generators) + break; } /* @@ -1733,6 +1734,8 @@ /* Update statistics */ stats.nof_generators++; + if (limit_generators && stats.nof_generators >= limit_generators) + break; continue; } /* while(!search_stack.empty()) */ @@ -5452,7 +5455,7 @@ component.clear(); component_elements = 0; sh_return = 0; - unsigned int sh_first = 0; + unsigned int sh_first = 1 << 31; unsigned int sh_size = 0; unsigned int sh_nuconn = 0; diff -Nur bliss-0.73/graph.hh bliss-0.73p/graph.hh --- bliss-0.73/graph.hh 2015-09-01 10:23:10.000000000 +0200 +++ bliss-0.73p/graph.hh 2017-12-21 14:36:35.388797479 +0100 @@ -20,6 +20,9 @@ along with bliss. If not, see . */ +/** This is a patched version of bliss by Thomas Rehn extended by method AbstractGraph::set_search_limits() */ +#define BLISS_PATCH_PRESENT + /** * \namespace bliss * The namespace bliss contains all the classes and functions of the bliss @@ -111,6 +114,14 @@ +/** moved here from graph.cc by Thomas Rehn, 2011-07-12 */ +typedef struct { + unsigned int splitting_element; + unsigned int certificate_index; + unsigned int subcertificate_length; + UintSeqHash eqref_hash; +} PathInfo; + @@ -284,7 +295,20 @@ opt_use_long_prune = active; } - + /// information vector about first path + /** added by Thomas Rehn, 2011-07-12 */ + std::vector get_first_path_info() { return first_path_info; } + + /// limits number of search nodes and generators during the backtrack search + /** added by Thomas Rehn, 2012-01-12 + * + * \param searchNodeLimit if non-zero, limits the number of search nodes in search tree + * \param generatorLimit if non-zero, limits the maximal number of automorphism group generators to be found + */ + void set_search_limits(const unsigned int searchNodeLimit, const unsigned int generatorLimit) { + limit_search_nodes = searchNodeLimit; + limit_generators = generatorLimit; + } protected: /** \internal @@ -519,6 +543,11 @@ + /** added by Thomas Rehn, 2011-07-12 */ + std::vector first_path_info; + + unsigned int limit_search_nodes; + unsigned int limit_generators; }; @@ -747,7 +776,6 @@ */ void set_splitting_heuristic(const SplittingHeuristic shs) {sh = shs; } - };