Page 1 of 1

b) Refer to the pseudocode snippet below, which refers to a well-known search algorithm. Briefly explain what issue this

Posted: Tue May 24, 2022 7:53 am
by answerhappygod
B Refer To The Pseudocode Snippet Below Which Refers To A Well Known Search Algorithm Briefly Explain What Issue This 1
B Refer To The Pseudocode Snippet Below Which Refers To A Well Known Search Algorithm Briefly Explain What Issue This 1 (32.66 KiB) Viewed 27 times
b) Refer to the pseudocode snippet below, which refers to a well-known search algorithm. Briefly explain what issue this algorithm has in relation to searching over local minima. Modify the algorithm to add exploratory behaviour. You can provide your answer as a simple pseudocode. [8 marks] 1. currentSolution = copy(startSolution); 2. bestSolution = copy(currentSolution); bestEval evaluate (currentSolution); 3. improved=false; 4. while (termination criteria not satisfied) { 5. neighborsSet = NeigborsOf(currentSolution); for all s in neighborsSet { 6. 7. tmpEval= evaluate(s); if (tmpEval < bestEval) { 8. 9. bestSolution = s; bestEval= tmpEval; improved=true; } // end if 10. 11. } // end for 12. if (improved) currentSolution = copy(bestSolution); 13. else return currentSolution; 14. } //end while