fake_all_different.c
594 Bytes
/*
* fake_all_different.c
*
* Created on: 21/01/2017
* Author: pedro
*/
#include "fake_all_different.h"
#include "ne.h"
/*
* Simulates the all-different constraint by using ne binary constraints
* X_ids - array with the IDs of the variables that are constrained by this constraint
* n_vs - number of ID variables in vs_id
* reif_v_id - ID of the reification variable or -1 if none
*/
void c_fake_all_different(unsigned int* X_ids, unsigned int n_vs) {
unsigned int i, j;
for (i = 0; i < n_vs; i++) {
for (j = i + 1; j < n_vs; j++) {
c_ne(X_ids[i], X_ids[j]);
}
}
}