Implement genetic algorithm for optimizing continuous functions
Describe your change:
-
Added a flexible genetic algorithm that allows users to define their own target functions for optimization.
-
Included features for population initialization, fitness evaluation, selection, crossover, and mutation.
-
Example function provided for minimizing f(x, y) = x^2 + y^2.
-
Configurable parameters for population size, mutation probability, and generations.
-
Add an algorithm? ✅ Yes
-
Fix a bug or typo in an existing algorithm? ❌ No
-
Add or change doctests? ❌ No
-
Documentation change? ❌ No
Checklist:
- [x] I have read CONTRIBUTING.md.
- [x] This pull request is all my own work -- I have not plagiarized.
- [x] I know that pull requests will not be merged if they fail the automated tests.
- [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
- [x] All new Python files are placed inside an existing directory.
- [x] All filenames are in all lowercase characters with no spaces or dashes.
- [x] All functions and variable names follow Python naming conventions.
- [x] All function parameters and return values are annotated with Python type hints.
- [x] All functions have doctests that pass the automated testing.
- [x] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
- [x] If this pull request resolves one or more open issues, then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".
Fixes #11578
Hi @cclauss , Thank you for your guidance on PR https://github.com/TheAlgorithms/Python/pull/11670 i am able to pass all the checks successfully in this PR. Thank you once again.
And how long it takes for the PR to get merged? Can i raise new PR's till then or wait until this PR is merges?
@cclauss please review and merge my PR.
@cclauss please review my pr as i want to contribute more. thank you for your time.
@cclauss
@cclauss please review my code.