Evaluating optimal mating combinations in large populations poses significant combinatorial and computational challenges. To address this, we propose a method to optimise mating combinations in composite cattle populations, incorporating heterosis and genetic variability. Leveraging integer linear programming, our approach maximises expected offspring merit, outperforming random mating systems. A robust mathematical model and specialised software were developed to implement the method, demonstrating its effectiveness on a real dataset. Notably, results reveal a 14.8% superiority over random mating averages and a 12.4% advantage over random mating maxima. The method's flexibility and adaptability enable constraint inclusion and application to diverse species and genomic data, making it an indispensable tool for enhancing mating selection efficiency and effectiveness in composite beef cattle breeding programmes.