Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Development Developing a MAX-CSP Solver Karl Lieberherr.

Similar presentations


Presentation on theme: "Software Development Developing a MAX-CSP Solver Karl Lieberherr."— Presentation transcript:

1 Software Development Developing a MAX-CSP Solver Karl Lieberherr

2 General solver Based on transition system Correctness of solver –Does it find maximum? –Does it find a assignment satisfying t G ?

3 General Theme The average over a set of assignments is f. We want to derive an algorithm that finds an assignment ≥ f. Two choices: –randomized algorithm (very simple but has failure probability) –derandomized algorithm (more complex)

4 Derandomized algorithm Need a correctness proof For each variable x in H if average H(k=1) > average H(k=0) Need: average H ≥ max(average H(k=1), average H(k=0) )

5 Polynomials based on Averages mean H (n,k)= average fraction of satisfied constraints in H among all assignments to the n variables of H that set k variables to true. appmean H (x) = average fraction of satisfied constraints in H among all assignments that are generated with a bent coin of probability x. –The averaging includes all assignments but they have different weights based on the Binomial Distribution. –We generate the assignments following the binomial distribution and appmean gives the expected value of a random variable: the fraction of satisfied constraints. –expected value = mean

6 Look-ahead polynomial lap F,N (x) = appmean n-map(F,N) (x)

7 Binomial Distribution X ~ B(n,p) The probability of getting exactly k successes: C(n,k)*p k *(1-p) n-k E(X) = np The most likely value: largest integer ≤ (n+1)*p

8 Start with a simple case meanall H = average fraction of satisfied constraints in H among all assignments to the variables of H. meanall H = 1/2 (meanall H(k=1) + meanall H(k=0) ) meanall H = Sum all relations R in H t R (H) m R 2 –r(R) –m R is the number of satisfying rows in truth table of R. –check: relation 22: 3/8 –max 0 ≤ k ≤ n mean H (n,k) = 4/9 + h(n)

9 Start with a simple case meanall H = 1/2 (meanall H(k=1) + meanall H(k=0) ) Proof: Consider all 2^n assignments. Half set k=1 and half set k=0. We compute the average for the two halves separately and then average the two averages to get the overall average.

10 Start with a simple case Algorithm MEANALL Input: H = CSP(G)-formula Output: An assignment which satisfies meanall H if meanall H(k=1) > meanall H(k=0)

11 Next more complicated case mean H (n,k) Want an algorithm for finding an assignment at least as good as mean H (n,k)

12 mean polynomials mean H (n,k)= k/n * mean H(k=1) (n-1,k-1) + (n-k)/n * mean H(k=0) (n-1,k) C(n,k) = C(n-1,k-1)+C(n,k)

13 Example C(5,2) = C(4,1) + C(4,2) 10 = 4 + 6 mean(5,2) = C(4,1)/C(5,2) * mean(4,1) + C(4,2)/C(5,2) * mean(4,2) mean(n,k) = C(n-1,k-1)/C(n,k) * mean(n-1,k-1) + C(n-1,k)/C(n,k) * mean(n-1,k)

14 Ahmed’s and Christine’s conjecture For all assignments M: max 0 ≤ x ≤ 1 appmean n-map(H,M) (x) ≥ fsat(H,M) An assignment M is maximal if max 0 ≤ x ≤ 1 appmean n-map(H,M) (x) = fsat(H,M) Intuition: an assignment is maximal if the polynomials don’t help.

15 Question Does it matter in the definition of maximal whether we use appmean or mean?

16 Proofs or Counterexamples Using Daniel’s programs, we can easily find counterexamples. If we cannot find counterexamples, we should find proofs.

17 Which ones are correct? mean H (n,k)= k/n mean H(k=1) (n-1,k-1) + (n-k)/n mean H(k=0) (n-1,k) mean H (n,k) ≤ max( mean H(k=1) (n-1,k-1), mean H(k=0) (n-1,k)) appmean H (x) ≤ max( appmean H(k=1) (x), appmean H(k=0) (x))

18 Which ones are correct? Def: maxappmean H (x) = max 0 ≤ x ≤ 1 appmean H (x) maxappmean H (x) ≤ max( maxappmean H(k=1) (x), maxappmean H(k=0) (x))

19 By Analogy mean H (n,k)=k/n mean H(k=1) (n-1,k-1) +(n- k)/n mean H(k=0) (n-1,k) For 1 ≤ k ≤ n: appmean H (k/n)=k/n appmean H(k=1) ((k-1)/(n-1)) +(n-k)/n appmean H(k=0) (k/(n-1))

20 Example Relation = 22 appmean(x) = 3 x (1-x) 2 mean(n,k) = (3 / C(3,1)) * k * C(n-k,2) / C(n,3) = k * C(n-k,2) / C(n,3) rough approximation: –k/n * ((n-k)/n) 2 * 1/2 * 6 = 3 x (1-x) 2


Download ppt "Software Development Developing a MAX-CSP Solver Karl Lieberherr."

Similar presentations


Ads by Google