Non-linear loads in circuits cause the appearance of harmonic disturbances both in voltage and current. In order to minimize the effects of these disturbances and, therefore, to control over the flow of electricity between the source and the load, they are often used passive or active filters. Nevertheless, determining the type of filter and the characteristics of their elements is not a trivial task. In fact, the development of algorithms for calculating the parameters of filters is still an open question. This paper analyzes the use of genetic algorithms to maximize the power factor compensation in non-sinusoidal circuits using passive filters, while concepts of geometric algebra theory are used to represent the flow of power in the circuits. According to the results obtained in different case studies, it can be concluded that the genetic algorithm obtain high quality solutions that could be generalized to similar problems of any dimension.