- 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 26 times
b) Refer to the pseudocode snippet below, which refers to a well-known search algorithm. Briefly explain what issue this
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
b) Refer to the pseudocode snippet below, which refers to a well-known search algorithm. Briefly explain what issue this
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