faculty of pure and applied sciences - The Department of Chemistry ...
faculty of pure and applied sciences - The Department of Chemistry ...
faculty of pure and applied sciences - The Department of Chemistry ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Java [3]<strong>The</strong> Optimization ProblemGiven a logic function, f: B n → B, with B = {0, 1}, find an optimal representation <strong>of</strong> f by:a) Exclusive-OR forms(XOR): f = C1 ⊕ C2 ⊕ … ⊕ Ck,b) Equivalence forms: f = D1 ∼ D2 ∼ … ∼ Dkc) Disjunctive forms: f = C1 ∨ C2 ∨ … ∨ Ckd) Conjunctive forms: f = D1 ∧ D2 ∧ … ∧ Dk“Optimal” can be defined as a minimum number <strong>of</strong> conjunctions, Ci, or disjunctions, Di, or as theminimum number <strong>of</strong> variables in the formula. For the XOR <strong>and</strong> equivalence forms, the optimizationcriteria will also be considered for different polarities: a formula has a given polarity if everyvariable appears only negated or only non-negated. For example, f = x1’ x2 x3 ⊕ x1’ x3 ⊕ x2, x1 isalways negated, x2, x3, <strong>and</strong> x4 are always non-negated.<strong>The</strong> challenge <strong>of</strong> these problems is the enormous complexity: for n variables, there are x 2functions,where x = 2 n but 2 y formulas <strong>of</strong> the given types, where y = 3 n . For practical applications, it is quitenormal to have values <strong>of</strong> n as high as 32 or even 64.A very import special case is the representation <strong>of</strong> logic functions by decision trees: <strong>The</strong> nodes <strong>of</strong>the trees are labelled by variables, the edges by values <strong>of</strong> variables (x=0 or x=1); the complexity <strong>of</strong>the trees depends on the order <strong>of</strong> the variables, hence, it is equal to n!, for n variables.Genetic Algorithms“Genetic Algorithms (GAs) are … stochastic algorithms whose search methods model some naturalphenomena: genetic inheritance <strong>and</strong> Darwinian strife for survival.” [4] <strong>The</strong>y start with a population<strong>of</strong> solution c<strong>and</strong>idates (the initial population). Genetic operators, mutation <strong>and</strong> crossover, are<strong>applied</strong> to individuals or pairs <strong>of</strong> individuals in the population to generate new members. A fitnessfunction is used to determine which individuals are solutions or the fittest at each stage <strong>of</strong> thealgorithm.Using a ternary coding <strong>and</strong> a complete enumeration <strong>of</strong> all conjunctions, every formula can berepresented (in principle) by a bit vector with the length 3 n . <strong>The</strong> Table gives examples <strong>of</strong> the ternarycoding scheme used to convert r<strong>and</strong>om numbers generated to the conjunctions they represent. <strong>The</strong>conjunctions that comprise a particular formula are coded into the bit vector <strong>of</strong> length n 3.Table:Correspondence between the numbers generated <strong>and</strong> the conjunctions theyrepresent, for 3 variables.R<strong>and</strong>om Numbers x1 x2 x3 Corresponding Conjunction5 0 1 - x1’x27 0 - 1 x1’x317 1 - - x120 - 0 - x2’Mutations change one or more bits r<strong>and</strong>omly, while crossover involves splitting two bit vectors intoparts <strong>and</strong> then recombining parts <strong>of</strong> different vectors. <strong>The</strong> new vectors (formulas) will be includedinto the population according to their fitness values. <strong>The</strong> number <strong>of</strong> function values that are correct51