# Exercises

Practice what we’ve learned so far.

## Exercise 1: Using both algorithms

Maximize the function $f(x, y) = -x^2-y^2+6x+4y$. Use both genetic algorithms and PSO. Compare the results of both approaches.

Get hands-on with 1200+ tech skills courses.