Gaining-Sharing Knowledge-based Algorithm
Gaining-Sharing Knowledge-based Algorithm (GSK)
- Year introduced
- 2019
- Original authors
- Ali Wagdy Mohamed; Anas A. Hadi; Ali Khater Mohamed
- Source of inspiration
- How humans gain and share knowledge
- Search space
- Continuous
- Optimization types
- Hyperparameter Optimization
- Applied research in the repository
- 0
Overview
Inspired by how humans gain and share knowledge through the stages of their lives: when young (Junior) a person learns from their close circle (friends and family), and when older (Senior) from successful and unsuccessful people in the wider society. The fraction of dimensions updated by each phase changes over time.
Source of inspiration and mechanism

A child gains knowledge from the people closest to them even if they are not experts, while an adult tends to learn from experienced and successful people and to avoid the mistakes of those who fail.
Initialization
Random.
Update mechanism
A per-dimension update by the two phases with greedy acceptance.
Exploration
The junior phase dominates at the start.
Exploitation
The senior phase dominates at the end.
Mathematical description
The number of dimensions updated by the junior phase is D_junior = D·(1 − G/GEN)^K, and the rest by the senior phase. The junior phase uses the two nearest neighbours in the ranking and a random individual, and the senior phase uses individuals from the best, middle and worst groups (p = 10%). The learning and sharing coefficients are k_f and k_r.
Number of dimensions in the junior phase
D_{junior} = D\times\left(1-\frac{G}{GEN}\right)^{K},\qquad D_{senior} = D - D_{junior}K is the knowledge rate (10).
Computational complexity: O(T\cdot N\cdot (D + C_f))
Pseudocode
Initialize; sort population
for G = 1..GEN:
D_junior = D*(1 - G/GEN)^K; D_senior = D - D_junior
junior phase on D_junior dims (nearest better/worse + random)
senior phase on D_senior dims (best p%, middle, worst p%)
greedy selection; sort
return bestPython implementation
There is currently no tested python implementation of this algorithm in the lab. We did not include untested code so that it is not used as a reference implementation.
Coefficients
| Parameter | Symbol | Typical value | Range | Description |
|---|---|---|---|---|
| Knowledge rate | K | 10 | ||
| Knowledge factor | k_f | 0.5 | ||
| Knowledge ratio | k_r | 0.9 | ||
| p | p | 0.1 |
Advantages
- A smooth, gradual transition between exploration and exploitation
- Strong performance in CEC. competitions
Limitations
Four parameters (K, k_f, k_r, p).
Use in artificial intelligence
Domains documented in the card: Machine learning, hyperparameter tuning
Continuous optimization and engineering constraints.
Hybridization potential
These are partnerships suggested theoretically in the card; any resulting design is presented as a "proposed hybrid method" until its results are compared with the literature.
Applied research from the repository
An aspect that did not appear in the current search results within the repository. This does not mean there is no published research outside it.
Original reference
Ali Wagdy Mohamed; Anas A. Hadi; Ali Khater Mohamed (2019). Gaining-sharing knowledge based algorithm for solving optimization problems: a novel nature-inspired algorithm. International Journal of Machine Learning and Cybernetics, Springer Science and Business Media LLC.
Verified DOI: 10.1007/s13042-019-01053-x
The bibliographic data match the Crossref record (checked 2026-11-20). There is no tested Python code for this algorithm in this version.
