Phase balancing is a highly complex problem that consists of minimizing power losses by swapping generation and loads along a distribution feeder. Being a discrete and nonlinear problem, its solution is usually subject to the use of heuristic methods such as Genetic Algorithms or Particle Swarm Optimization. However, the representation of the feasible space is challenging for conventional approaches. This paper proposes a heuristic algorithm which is based on group-theory, an algebraic modeling that allows a compact and efficient representation of the feasible space. The proposed representation not only allows to develop an algorithm that guarantees feasibility along the generations, but also permits its implementation in the crossover and the mutation steps. Formal definitions of groups are presented and complemented with a matrix homomorphisms that allows the implementation of the algorithm. Numerical calculations on the IEEE 13, IEEE 37 and IEEE 123 nodes test feeders complement the proposed analysis and confirm the efficiency of what is proposed.