-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: a51842efebef2c898364e617c974194f | ||
config: eccf12cbfb532c8f88c604652ac49677 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,126 @@ | ||
Neighborhood Operators | ||
================================== | ||
======================= | ||
|
||
The `pycellga.neighborhoods` module provides various neighborhood structures that define how individuals interact with their neighbors in the cellular genetic algorithm (CGA). These neighborhood operators are essential for managing the flow of information and maintaining diversity within the population. | ||
Each neighborhood module defines a specific spatial structure. Depending on the problem and the desired interaction level, users can select different neighborhood sizes and arrangements. | ||
This module provides various neighborhood structures for cellular genetic algorithms (CGAs). Neighborhood structures define how individuals interact with others in their immediate vicinity, playing a critical role in regulating the flow of information and maintaining diversity within the population. | ||
|
||
In cellular genetic algorithms, the concept of neighborhoods is integral to the evolutionary process. As shown in the diagram below, each individual in the population interacts with its neighbors during key stages of the evolutionary cycle: Selection, Recombination, Mutation, and Replacement. This localized interaction helps balance exploration and exploitation, promoting better local optimization while preserving diversity. | ||
|
||
.. image:: images/cycle_cga.png | ||
:scale: 40% | ||
:alt: Reproductive cycle of an individual in cGA | ||
:align: center | ||
|
||
Figure 1: A representation of the reproduction cycle with neighborhood structure in a cellular genetic algorithm. | ||
|
||
The neighborhood structure governs which individuals are selected for interactions during the evolutionary cycle. Depending on the problem requirements, users can choose different types of neighborhoods, such as linear or compact structures, to optimize the algorithm's performance. | ||
|
||
|
||
**The Concept of Neighborhood** | ||
------------------------------- | ||
|
||
Neighborhood refers to a spatial structure used to improve solutions in optimization problems. In most cases, the neighborhood of a solution represents solutions obtained through small modifications. | ||
|
||
Below are some popular neighborhood structures: | ||
|
||
- **Linear Neighborhood**: Individuals interact with neighbors arranged in a straight line. | ||
- **Compact Neighborhood**: A structure formed by cells surrounding an individual, allowing denser interaction. | ||
|
||
**Why Use Different Structures?** | ||
|
||
Each neighborhood structure is suited for specific problem types: | ||
- **Linear structures** are more appropriate for sequential or ordered problems. | ||
- **Compact structures** are ideal for scenarios requiring dense information sharing and local exploration. | ||
|
||
|
||
**Neighborhood Scheme Examples** | ||
------------------------ | ||
|
||
**Linear Neighborhood** | ||
A linear neighborhood structure refers to an arrangement where individuals interact with a specific number of neighbors in a straight line. For instance, consider a linear structure with 5 neighbors: | ||
|
||
.. image:: images/linear_5_example.png | ||
:scale: 40% | ||
:alt: Linear 5 Neighborhood Structure | ||
:align: center | ||
|
||
Figure 2: Linear 5 Neighborhood Structure | ||
|
||
Each individual shares information only with its immediate neighbors. This structure is suitable for cases requiring limited information flow. | ||
|
||
**Compact Neighborhood** | ||
Compact structures involve individuals sharing information intensively with all their surrounding neighbors. Below is an example of a compact structure with 9 neighbors: | ||
|
||
.. image:: images/compact_9_example.png | ||
:scale: 40% | ||
:alt: Compact 9 Neighborhood Structure | ||
:align: center | ||
|
||
Figure 3: Compact 9 Neighborhood Structure | ||
|
||
This structure can achieve faster convergence but must be used cautiously to maintain diversity. | ||
|
||
|
||
**API References** | ||
------------------ | ||
|
||
The following sections provide detailed documentation for the neighborhood operators available in the `pycellga.neighborhoods` package. | ||
|
||
**Linear 5** | ||
-------------- | ||
^^^^^^^^^^^^ | ||
|
||
Defines a linear neighborhood where each individual interacts with 5 neighbors arranged in a line. This structure is suitable for problems where limited, sequential interaction is beneficial. | ||
Description: A structure with 5 neighbors in a linear arrangement. | ||
|
||
.. automodule:: pycellga.neighborhoods.linear_5 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
**Linear 9** | ||
-------------- | ||
^^^^^^^^^^^^ | ||
|
||
A linear arrangement with 9 neighbors, encouraging a higher level of information flow along a line. This structure is ideal for applications that require extended sequential interactions. | ||
Description: A linear arrangement with 9 neighbors for greater information flow. | ||
|
||
.. automodule:: pycellga.neighborhoods.linear_9 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
**Compact 9** | ||
-------------- | ||
^^^^^^^^^^^^^ | ||
|
||
A compact neighborhood structure with 9 neighbors. This layout offers dense interaction among individuals, facilitating rapid convergence while maintaining diversity. | ||
Description: A compact structure with 9 neighbors for dense interaction. | ||
|
||
.. automodule:: pycellga.neighborhoods.compact_9 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
**Compact 13** | ||
-------------- | ||
^^^^^^^^^^^^^^ | ||
|
||
Defines a compact neighborhood structure where each individual interacts with its immediate and extended neighbors in a 13 grid. This structure allows moderate information sharing across neighboring cells. | ||
Description: A compact structure with 13 neighbors. | ||
|
||
.. automodule:: pycellga.neighborhoods.compact_13 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
**Compact 21** | ||
-------------- | ||
^^^^^^^^^^^^^^ | ||
|
||
Provides a compact arrangement where individuals have a 21 neighborhood structure. This layout encourages local exploration and is useful in tightly clustered populations. | ||
Description: A compact structure with 21 neighbors for broader information sharing. | ||
|
||
.. automodule:: pycellga.neighborhoods.compact_21 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
**Compact 25** | ||
-------------- | ||
^^^^^^^^^^^^^^ | ||
|
||
An extended compact neighborhood that includes more neighbors, with a 25 structure. This layout promotes broader information sharing, enhancing convergence in larger populations. | ||
Description: An extended compact structure with 25 neighbors for enhanced information sharing. | ||
|
||
.. automodule:: pycellga.neighborhoods.compact_25 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
:show-inheritance: |