Animal breeding involves directing the next generation’s genetics and phenotypic traits towards animal health and financial profits for the production system, using essentially two strategies: the selection and the mating systems. The mating system aims to provide a set of sire-dam pairs, producing the best animals according to some selection criteria and a mating strategy for the animals chosen for reproduction. This paper presents an R-package to compute the best pairing scheme to obtain optimal polynomial-time solutions for either mating between peers or compensatory mating. The algorithm for optimal mating runs in worst-case O(nm)-time while the compensatory mating takes O(m³), where n is the number of sires and m is the number of dams.