Add Simple hill climbing and steepest ascent algorithms in AI -> Algorithms #47 #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #47
Describe the add-ons or changes you've made 📃
I have added generalized Python code implementations for both Simple Hill Climbing and Steepest Ascent Hill Climbing algorithms, ensuring they can be adapted to various problems with an initial state, neighbours, and an evaluation function. Simple Hill Climbing stops at the first better neighbour, has lower computational complexity per step, but is more prone to local maxima. In contrast, Steepest Ascent Hill Climbing evaluates all neighbours and moves to the best one, resulting in higher computational complexity per step but reduced susceptibility to local maxima. Additionally, I provided a comprehensive comparison highlighting the key differences between the two algorithms in approach, computational cost, efficiency, and handling of local maxima, facilitating a clearer understanding of their respective applications and advantages.
Type of change ☑️
What sort of change have you made:
How Has This Been Tested? ⚙️
The generalized Python code implementations for Simple Hill Climbing and Steepest Ascent Hill Climbing algorithms have been tested using a variety of problem scenarios, including optimization tasks and search problems. Test cases included scenarios with different initial states and neighbour configurations to ensure the algorithms correctly identify and move towards optimal solutions. The verification process involved comparing the results with expected outcomes and checking for correct convergence behaviour. Additionally, edge cases were tested to confirm that the algorithms handle local maxima appropriately and exhibit the intended differences in their approach and computational efficiency.
Checklist: ☑️
Screenshots 📷
Note to reviewers 📄
Please let me know if the code meets the level of your satisfaction, or if it needs any updates.