Question: Question 2 : Solve the above problem ( 1 ) - ( 2 ) using the local search algorithm FM . Use your initial solution

Question 2: Solve the above problem (1)-(2) using the local search algorithm FM. Use
your initial solution x0=(x1,x2,cdots,x16) where xi=0 if the index i in xi is even and
xi=1 if the index i is odd. The step by step description of the Fiduccia and Mattheyses
algorithm is given below:
The Fiduccia and Mattheyses (FM) Algorithm
Take the initial x0, calculate f(x0), set xmax=x0; flag =1, Pass =1
Let F be the set of indices corresponding to unlocked/free variables (initially F=
{1,2,cdots,n}. Let L be the set of indices corresponding to locked variables (initially
L=O?)
WHILE flag =1
3.1 Set flag =0 & Epoch =0. Set F={1,2,cdots,n},L=O?
3.1.1 Until Epoch =n DO
3.1.2 For each jinF based on for Epoch=0), calculate xj=(x1,cdots,1}
{:xj,cdots,xn) by flipping xj and find f(xj).
3.1.3 Let xt=argmaxj{f(xj),jinF}. Set , Epoch=Epoch+1
3.1.4 EndDO
3.2 Let xt be the best solution at the end of the t-th Epoch and x=argmaxt{f(xt)tin
L}
3.3 IF f(x)>f(x0)
3.3.1,xmax=x,x0=x, flag =1, Pass = Pass +1
3.4 ENDIF
ENDWHILE
RETURN xmax
Question 2 : Solve the above problem ( 1 ) - ( 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!