Skip to content

Commit 28ac6b3

Browse files
authored
Merge pull request #2 from vrettasm/multimodal_feature
Multi-modal feature supported.
2 parents 7e7b875 + 24a639b commit 28ac6b3

82 files changed

Lines changed: 1773 additions & 530 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ parallel pool). So the default setting here is "parallel=False". Regarding the I
2121
parallel mode by definition.
2222

2323
> **NEWS**:
24-
> Recently a new feature was added "adapt_probs: (bool)". This option if enabled, will allow the crossover and
25-
> mutation probabilities to adapt according to the convergence of the population to a single solution. This uses
26-
> the average Hamming distance to set a threshold value and either increase or decrease the genetic probabilities
27-
> by a pre-defined amount.
24+
> Recently the new feature "Neighborhood Selector" was added. This selector operator is used for problems with multi
25+
> modal objective functions. It allows the population to focus on multiple areas of the search space and detect more
26+
> than one optimal values. This features works in both computational modes (StandardGA and IslandModelGA).
2827
>
2928
3029
The current implementation offers a variety of genetic operators including:
3130

3231
- **Selection operators**:
3332
- [Linear Rank Selector](pygenalgo/operators/selection/linear_rank_selector.py)
33+
- [Neighborhood Selector](pygenalgo/operators/selection/neighborhood_selector.py)
3434
- [Random Selector](pygenalgo/operators/selection/random_selector.py)
3535
- [Roulette Wheel Selector](pygenalgo/operators/selection/roulette_wheel_selector.py)
3636
- [Stochastic Universal Selector](pygenalgo/operators/selection/stochastic_universal_selector.py)
@@ -81,13 +81,19 @@ so new things might come along the way.
8181
There are two options to install the software.
8282

8383
The easiest way is to visit the GitHub web-page of the project and simply download the source code in
84-
[zip](https://github.com/vrettasm/PyGeneticAlgorithms/archive/refs/heads/master.zip) format. This option does not
85-
require a prior installation of git on the computer.
84+
[zip](https://github.com/vrettasm/PyGeneticAlgorithms/archive/refs/heads/master.zip) format. This option
85+
does not require a prior installation of git on the computer.
8686

8787
Alternatively one can clone the project directly using git as follows:
8888

8989
git clone https://github.com/vrettasm/PyGeneticAlgorithms.git
9090

91+
After the download of the code (or the git clone), one can use the command:
92+
93+
pip install pygenalgo
94+
95+
This will install the PyGenAlgo in the package management system.
96+
9197
### Required packages
9298

9399
The recommended version is Python 3.10 (and above). To simplify the required packages just use:
@@ -141,24 +147,27 @@ Once the fitness function is defined correctly the next steps are straightforwar
141147

142148
Some optimization examples on how to use these algorithms:
143149

144-
| **Problem** | **Variables** | **Objectives** | **Constraints** | **Mode** |
145-
|:-----------------------------------------------------------|:-------------:|:--------------:|:---------------:|:--------:|
146-
| [Sphere](examples/sphere.ipynb) | M (=5) | 1 | no | serial |
147-
| [Rastrigin](examples/rastrigin.ipynb) | M (=5) | 1 | no | serial |
148-
| [Rosenbrock](examples/rosenbrock_on_a_disk.ipynb) | M (=2) | 1 | 1 | serial |
149-
| [Binh & Korn](examples/binh_and_korn_multiobjective.ipynb) | M (=2) | 2 | 2 | serial |
150-
| [Sphere](examples/sphere_in_parallel.ipynb) | M (=10) | 1 | no | parallel |
151-
| [Easom](examples/easom_in_parallel.ipynb) | M (=2) | 1 | no | parallel |
152-
| [Traveling Salesman Problem](examples/tsp.ipynb) | M (=10) | 1 | yes | serial |
153-
| [N-Queens puzzle](examples/queens_puzzle.ipynb) | M (=8) | 1 | yes | parallel |
154-
| [OneMax](examples/one_max.ipynb) | M (=50) | 1 | no | serial |
155-
| [Tanaka](examples/tanaka_multiobjective.ipynb) | M (=2) | 2 | 2 | serial |
156-
| [Zakharov](examples/zakharov.ipynb) | M (=8) | 1 | no | serial |
157-
| [Osyczka](examples/osyczka_kundu_multiobjective.ipynb) | 6 | 2 | 6 | parallel |
150+
| **Problem** | **Variables** | **Objectives** | **Constraints** | **Optima** |
151+
|:-----------------------------------------------------------|:-------------:|:--------------:|:---------------:|:----------:|
152+
| [Sphere](examples/sphere.ipynb) | M (=5) | 1 | no | single |
153+
| [Rastrigin](examples/rastrigin.ipynb) | M (=5) | 1 | no | single |
154+
| [Rosenbrock](examples/rosenbrock_on_a_disk.ipynb) | M (=2) | 1 | 1 | single |
155+
| [Binh & Korn](examples/binh_and_korn_multiobjective.ipynb) | M (=2) | 2 | 2 | single |
156+
| [Sphere (parallel)](examples/sphere_in_parallel.ipynb) | M (=10) | 1 | no | single |
157+
| [Easom (parallel)](examples/easom_in_parallel.ipynb) | M (=2) | 1 | no | single |
158+
| [Traveling Salesman](examples/tsp.ipynb) | M (=10) | 1 | yes | single |
159+
| [N-Queens](examples/queens_puzzle.ipynb) | M (=8) | 1 | yes | single |
160+
| [OneMax](examples/one_max.ipynb) | M (=50) | 1 | no | single |
161+
| [Tanaka](examples/tanaka_multiobjective.ipynb) | M (=2) | 2 | 2 | single |
162+
| [Zakharov](examples/zakharov.ipynb) | M (=8) | 1 | no | single |
163+
| [Osyczka](examples/osyczka_kundu_multiobjective.ipynb) | 6 | 2 | 6 | single |
164+
| [Shubert](examples/shubert_2D.ipynb) | 2 | 1 | no | multiple |
165+
| [Gaussian Mixture](examples/gaussian_mixture_2D.ipynb) | 2 | 1 | no | multiple |
166+
158167

159168
Constraint optimization problems can be easily addressed using the [Penalty Method](https://en.wikipedia.org/wiki/Penalty_method).
160169
Moreover, multi-objective optimizations (with or without constraints) can also be solved, using the _weighted sum method_,
161-
as shown in the examples above.
170+
as shown in the examples above. For multimodal optimizations check examples **Shubert** and **Gaussian Mixture**.
162171

163172
## References and Documentation
164173

59.7 KB
Binary file not shown.

docs/_build/doctrees/index.doctree

6 Bytes
Binary file not shown.
6 Bytes
Binary file not shown.
12 Bytes
Binary file not shown.
2.79 KB
Binary file not shown.
240 Bytes
Binary file not shown.
324 Bytes
Binary file not shown.
2.7 KB
Binary file not shown.
180 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)