Particle Swarm Optimization (PSO)
PSO (Particle Swarm Optimization) is a population based optimization technique developed by Dr. Eberhart and Dr. Kennedy in 1995, it is inspired by the observation of animal movements such as birds trying to find food, and affecting other individuals. In science, PSO is used for trying to improve a candidate solution with the given measure. Here are some parts in order to find the optimal solution in PSO:
- Initialization: Initialize the first particle population and it’s velocity.
- Updating Velocity: Velocity depends on 2 things: Global Best(best position obtained) and Local Best(best current solution)
- Update particle position: calculating new velocity.

#PSO function to find the best solution
#FUN <- objective function
#optimType <- represents type of optimization, can be either MIN or MAX (default value: MIN)
#numVar <- determines number variables
#numPopulation <- determines number populations (default value:40)
#maxIter <- determines maximum number of iterations (default value:500)
#rangeVar <- matrix that contains variables, lower and upper bound
#Vmax <- determines maximum particles velocity (default value:2)
#ci <- individual cognitive (default value: 1.49445)
#cg <- group cognitive (default value: 1.49445)
#w <- weight (default value: 0.729)


