forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
/
bliss-0.73.patch
147 lines (116 loc) · 3.99 KB
/
bliss-0.73.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
diff -u bliss-0.73.orig/graph.cc bliss-0.73/graph.cc
--- bliss-0.73.orig/graph.cc 2015-09-01 09:23:10.000000000 +0200
+++ bliss-0.73/graph.cc 2020-07-03 10:11:29.480649776 +0200
@@ -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<TreeNode> search_stack;
- std::vector<PathInfo> first_path_info;
+ // first_path_info moved to graph.hh by Thomas Rehn, 2011-07-12
std::vector<PathInfo> 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;
Seulement dans bliss-0.73: graph.cc.orig
diff -u bliss-0.73.orig/graph.hh bliss-0.73/graph.hh
--- bliss-0.73.orig/graph.hh 2015-09-01 09:23:10.000000000 +0200
+++ bliss-0.73/graph.hh 2020-07-03 10:11:29.484649847 +0200
@@ -20,6 +20,9 @@
along with bliss. If not, see <http://www.gnu.org/licenses/>.
*/
+/** 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<PathInfo> 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<PathInfo> first_path_info;
+
+ unsigned int limit_search_nodes;
+ unsigned int limit_generators;
};
diff -u bliss-0.73.orig/Makefile bliss-0.73/Makefile
--- bliss-0.73.orig/Makefile 2015-09-01 09:23:10.000000000 +0200
+++ bliss-0.73/Makefile 2020-07-03 10:11:29.484649847 +0200
@@ -5,7 +5,7 @@
CFLAGS += --pedantic
CFLAGS += -O9
#CFLAGS += -DBLISS_DEBUG
-CFLAGS += -fPIC
+CFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
SRCS = defs.cc graph.cc partition.cc orbit.cc uintseqhash.cc heap.cc
SRCS += timer.cc utils.cc bliss_C.cc