This paper addresses the school timetabling problem, which consists of defining the date and time in which classes will be given by teachers in educational institutions. For this purpose, a tool that uses Operational Research (OR) techniques was developed, focused on generating and optimizing Elementary and High School timetables, taking into account teachers’ preferences for certain days or for sequenced (twinned) classes. Conductive to solving the problem, a Non Linear Binary Integer Programming mathematical model (NLBIP) and Local Search (LS) and Iterated Local Search (ILS) procedures were comparatively applied. A real problem with 14 timetables of public schools in the city of Araucária (in Paraná State, Brazil) was analyzed. The results indicate that the computational time required by the mathematical model is feasible for the problems in question. The ILS technique has the potential for testing larger scale problems, as it presents a dispersion of 3.5% to 7.7% relative to the optimal solution (obtained by the NLBIP) and a computational time that is 15 to 338 times faster.