Genetic algorithm (triangle decision)