An Efficient Local Search for Partial Latin Square Extension Problem

  • Kazuya HaraguchiEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9075)


A partial Latin square (PLS) is a partial assignment of \(n\) symbols to an \(n\times n\) grid such that, in each row and in each column, each symbol appears at most once. The partial Latin square extension problem is an NP-hard problem that asks for a largest extension of a given PLS. In this paper we propose an efficient local search for this problem. We focus on the local search such that the neighborhood is defined by \((p,q)\) -swap, i.e., removing exactly \(p\) symbols and then assigning symbols to at most \(q\) empty cells. For \(p\in \{1,2,3\}\), our neighborhood search algorithm finds an improved solution or concludes that no such solution exists in \(O(n^{p+1})\) time. We also propose a novel swap operation, Trellis-swap, which is a generalization of \((1,q)\)-swap and \((2,q)\)-swap. Our Trellis-neighborhood search algorithm takes \(O(n^{3.5})\) time to do the same thing. Using these neighborhood search algorithms, we design a prototype iterated local search algorithm and show its effectiveness in comparison with state-of-the-art optimization solvers such as IBM ILOG CPLEX and LocalSolver.


Partial latin square extension problem Maximum independent set problem Metaheuristics Local search 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Alidaee, B., Kochenberger, G., Wang, H.: Simple and fast surrogate constraint heuristics for the maximum independent set problem. J. Heuristics 14, 571–585 (2008)CrossRefGoogle Scholar
  2. 2.
    Andrade, D., Resende, M., Werneck, R.: Fast local search for the maximum independent set problem. J. Heuristics 18, 525–547 (2012). the preliminary version appeared in Proc. 7th WEA (LNCS vol. 5038), pp. 220–234 (2008)CrossRefGoogle Scholar
  3. 3.
    Ansótegui, C., Val, A., Dotú, I., Fernández, C., Manyá, F.: Modeling choices in quasigroup completion: SAT vs. CSP. In: Proc. National Conference on Artificial Intelligence, pp. 137–142 (2004)Google Scholar
  4. 4.
    Appa, G., Magos, D., Mourtos, I.: Searching for mutually orthogonal latin squares via integer and constraint programming. European J. Operational Research 173(2), 519–530 (2006)CrossRefzbMATHMathSciNetGoogle Scholar
  5. 5.
    Barry, R.A., Humblet, P.A.: Latin routers, design and implementation. IEEE/OSA J. Lightwave Technology 11(5), 891–899 (1993)CrossRefGoogle Scholar
  6. 6.
    Barták, R.: On generators of random quasigroup problems. In: Hnich, B., Carlsson, M., Fages, F., Rossi, F. (eds.) CSCLP 2005. LNCS (LNAI), vol. 3978, pp. 164–178. Springer, Heidelberg (2006) CrossRefGoogle Scholar
  7. 7.
    Colbourn, C.J.: The complexity of completing partial latin squares. Discrete Applied Mathematics 8, 25–30 (1984)CrossRefzbMATHMathSciNetGoogle Scholar
  8. 8.
    Colbourn, C.J., Dinitz, J.H.: Handbook of Combinatorial Designs. Chapman & Hall/CRC, 2nd edn. (2006)Google Scholar
  9. 9.
    Crawford, B., Aranda, M., Castro, C., Monfroy, E.: Using constraint programming to solve sudoku puzzles. In: Proc. ICCIT 2008, vol. 2, pp. 926–931 (2008)Google Scholar
  10. 10.
    Crawford, B., Castro, C., Monfroy, E.: Solving sudoku with constraint programming. In: Shi, Y., Wang, S., Peng, Y., Li, J., Zeng, Y. (eds.) MCDM 2009. CCIS, vol. 35, pp. 345–348. Springer, Heidelberg (2009) CrossRefGoogle Scholar
  11. 11.
    Cygan, M.: Improved approximation for 3-dimensional matching via bounded pathwidth local search. In: Proc. FOCS 2013, pp. 509–518 (2013)Google Scholar
  12. 12.
    Eén, N., Sörensson, N.: The MiniSat Page, January 20, 2015.
  13. 13.
    Fürer, M., Yu, H.: Approximating the k-set packing problem by local improvements. In: Fouilhoux, P., Gouveia, L.E.N., Mahjoub, A.R., Paschos, V.T. (eds.) ISCO 2014. LNCS, vol. 8596, pp. 408–420. Springer, Heidelberg (2014) CrossRefGoogle Scholar
  14. 14.
    Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman & Company (1979)Google Scholar
  15. 15.
    Glover, F., Kochenberger, G. (eds.): Handbook of Metaheuristics. Kluwer Academic Publishers (2003)Google Scholar
  16. 16.
    Gomes, C.P., Regis, R.G., Shmoys, D.B.: An improved approximation algorithm for the partial latin square extension problem. Operations Research Letters 32(5), 479–484 (2004)CrossRefzbMATHMathSciNetGoogle Scholar
  17. 17.
    Gomes, C.P., Selman, B.: Problem structure in the presence of perturbations. In: Proc. AAAI-97, pp. 221–227 (1997)Google Scholar
  18. 18.
    Gomes, C.P., Shmoys, D.B.: Completing quasigroups or latin squares: a structured graph coloring problem. In: Proc. Computational Symposium on Graph Coloring and Generalizations (2002)Google Scholar
  19. 19.
    Gomes, C., Sellmann, M., van Es, C., van Es, H.: The challenge of generating spatially balanced scientific experiment designs. In: Régin, J.-C., Rueher, M. (eds.) CPAIOR 2004. LNCS, vol. 3011, pp. 387–394. Springer, Heidelberg (2004) CrossRefGoogle Scholar
  20. 20.
    Gonzalez, T.F. (ed.): Handbook of Approximation Algorithms and Metaheuristics. Chapman & Hall/CRC (2007)Google Scholar
  21. 21.
    Hajirasouliha, I., Jowhari, H., Kumar, R., Sundaram, R.: On completing latin squares. In: Thomas, W., Weil, P. (eds.) STACS 2007. LNCS, vol. 4393, pp. 524–535. Springer, Heidelberg (2007) CrossRefGoogle Scholar
  22. 22.
    Halldórsson, M.M., Losievskaja, E.: Independent sets in bounded-degree hypergraphs. Discrete Applied Mathematics 157(8), 1773–1786 (2009)CrossRefzbMATHMathSciNetGoogle Scholar
  23. 23.
    Haraguchi, K., Ono, H.: Approximability of latin square completion-type puzzles. In: Ferro, A., Luccio, F., Widmayer, P. (eds.) FUN 2014. LNCS, vol. 8496, pp. 218–229. Springer, Heidelberg (2014) CrossRefGoogle Scholar
  24. 24.
    Hopcroft, J.E., Karp, R.M.: An \(n^{5/2}\) algorithm for maximum matchings in bipartite graphs. SIAM J. Computing 2(4), 225–231 (1973)CrossRefzbMATHMathSciNetGoogle Scholar
  25. 25.
    Hurkens, C.A.J., Schrijver, A.: On the size of systems of sets every \(t\) of which have an SDR, with an application to the worst-case ratio of heuristics for packing problems. SIAM J. Discrete Mathematics 2(1), 68–72 (1989)CrossRefzbMATHMathSciNetGoogle Scholar
  26. 26.
  27. 27.
    Itoyanagi, J., Hashimoto, H., Yagiura, M.: A local search algorithm with large neighborhoods for the maximum weighted independent set problem. In: Proc. MIC 2011, pp. 191–200 (2011)Google Scholar
  28. 28.
    Kumar, R., Russel, A., Sundaram, R.: Approximating latin square extensions. Algorithmica 24(2), 128–138 (1999)CrossRefzbMATHMathSciNetGoogle Scholar
  29. 29.
    Lambert, T., Monfroy, E., Saubion, F.: A generic framework for local search: application to the sudoku problem. In: Alexandrov, V.N., van Albada, G.D., Sloot, P.M.A., Dongarra, J. (eds.) ICCS 2006. LNCS, vol. 3991, pp. 641–648. Springer, Heidelberg (2006) CrossRefGoogle Scholar
  30. 30.
    Le Bras, R., Perrault, A., Gomes, C.P.: Polynomial time construction for spatially balanced latin squares. Tech. rep., Computing and Information Science Technical Reports, Cornell University (2012).
  31. 31.
    Lewis, R.: Metaheuristics can solve sudoku puzzles. J. Heuristics 13(4), 387–401 (2007)CrossRefGoogle Scholar
  32. 32.
    LocalSolver, January 20, 2015.
  33. 33.
    Ma, F., Zhang, J.: Finding orthogonal latin squares using finite model searching tools. Science China Information Sciences 56(3), 1–9 (2013)CrossRefGoogle Scholar
  34. 34.
    Simonis, H.: Sudoku as a constraint problem, January 20, 2015. hsimonis/sudoku.pdf
  35. 35.
    Smith, C., Gomes, C., Fernandez, C.: Streamlining local search for spatially balanced latin squares. In: Proc. IJCAI 2005, pp. 1539–1541 (2005)Google Scholar
  36. 36.
    Soto, R., Crawford, B., Galleguillos, C., Monfroy, E., Paredes, F.: A hybrid AC3-tabu search algorithm for solving sudoku puzzles. Expert Systems with Applications 40(15), 5817–5821 (2013)CrossRefGoogle Scholar
  37. 37.
    Tamura, N.: Sugar: a SAT-based Constraint Solver, January 20, 2015.
  38. 38.
    The International SAT Competitions, January 20, 2015.
  39. 39.
    Vieira Jr., H., Sanchez, S., Kienitz, K.H., Belderrain, M.C.N.: Generating and improving orthogonal designs by using mixed integer programming. European J. Operational Research 215(3), 629–638 (2011)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.Faculty of CommerceOtaru University of CommerceOtaruJapan

Personalised recommendations