do not created negated table when too big

This commit is contained in:
Laurent Perron
2019-04-16 13:10:45 -07:00
parent efe8925b38
commit e6d9c3659e

View File

@@ -314,7 +314,8 @@ void AddTableConstraint(const std::vector<IntegerVariable>& vars,
}
}
if (prefixes_are_all_different && num_prefix_tuples < max_num_prefix_tuples) {
if (prefixes_are_all_different && num_prefix_tuples < max_num_prefix_tuples &&
max_num_prefix_tuples < 4 * num_prefix_tuples) {
// If we have a table of 'unique prefix' => value tuples.
// This table will likely not be negated, as the density of tuples will be
// less than 1 / size of the domain of the last variable.