This is a pythonic implementation of ECOB, an optimization algorithm developed by A. Kaveh and M.Ilchi Ghazaan. Link to the paper.
Colliding Bodies Optimization (CBO) is a new multi-agent meta-heuristic optimization algorithm based on the physical laws governing one-dimensional collision between two bodies. Each agent is modelled as a body with a specified mass and velocity. A collision occurs between pairs of objects and new positions are updated to find the global or near-global solutions. Enhanced colliding bodies optimization (ECBO) uses memory to save the best solutions and utilizes a mechanism to escape local optima. The code is presented in Python as a jupyter notebook as well as a python file.
Following images show the distribution of the colliding bodies in three dimensions when ECOB is applied to minimize the function:
(x-20)**2 + (y - 20)**2 = 0
print("Best answer:", np.round(cb[0], 2))
Best answer: [ 0.07 20. 20. ]
Correct answer: [don't care, 20, 20]