Programming with MATLAB to color latin squares




Latin square, Transversal, Partial transversal, Chromatic number, Dihedral group


With a Matlab programming we will find the chromatic number for all Latin squares of order smaller than 7. Previously, a manual algorithm for coloring the Latin square was provided. This algoritm determined the chromatic number of some special classes of Latin squares such as Cyclic or Dihedral, so, we tried to speed up the process of this algorithm with a programming.

Author Biographies

A. Shokri, Islamic Azad University- South Tehran Branch.

Dept. of Mathematics

M. Golriz, Islamic Azad University- South Tehran Branch.

Dept. of Mathematics.

M. Alaeiyan, Iran University of Science and Technology.

Dept. of Mathematics.


N. Besharati, L. Goddyn, E. S. Mahmoodian, and M. Mortezaeefar, “On the chromatic number of latin square number of latin square graphs”, Discrete mathematics, vol. 339, no. 11, pp. 2613-2619, Nov. 2016, doi: 10.1016/j.disc.2016.04.025

T. Mora, Ed., Applied algebra, algebraic algorithms and error-correcting codes. Berlin: Springer, 1989, doi: 10.1007/3-540-51083-4

M. Mortezaeefar, “Colorings of latin square graphs and block designs”, Master’s thesis, Sharif University of Technology, 2009.

K. Shokri, "On the latin square of groups and their coloring", Master’s thesis, Sharif University of Technology, 2015.

A. Shokri and M. Golriz, “A new algorithmic method to compute the chromatic number of dihedral group”, in press.

I. Wanless, “Transversals in latin squares: a survey,” in Surveys in Combinatorics 2011, R. Chapman, Ed. Cambridge: Cambridge University Press, 2011, pp. 403–437, doi: 10.1017/CBO9781139004114.010



How to Cite

A. Shokri, M. Golriz, and M. Alaeiyan, “Programming with MATLAB to color latin squares”, Proyecciones (Antofagasta, On line), vol. 39, no. 4, pp. 933-943, Jul. 2020.