Class CrossWord

java.lang.Object
org.jacop.examples.fd.ExampleFD
org.jacop.examples.fd.crosswords.CrossWord

public class CrossWord extends ExampleFD
It is an example of the power of ExtensionalSupportMDD constraint which can be used to efficiently model and solve CrossWord puzzles.
Version:
4.8

This program uses problem instances and dictionary obtained from Hadrien Cambazard.

  • Field Details

  • Constructor Details

    • CrossWord

      public CrossWord()
  • Method Details

    • model

      public void model()
      model()
      Specified by:
      model in class ExampleFD
    • printSolution

      public void printSolution(char[][] crossWordTemplate)
      It prints a variable crosswordTemplate.
      Parameters:
      crossWordTemplate - the template
    • readDictionaryFromFile

      public void readDictionaryFromFile(String file, List<Integer> wordSizes)
      It reads a dictionary. For every word length specified it reads a dictionary and creates an MDD representation of it for use by an extensional constraint.
      Parameters:
      file - filename containing dictionary
      wordSizes - size of the words
    • searchAllAtOnceNoRecord

      public boolean searchAllAtOnceNoRecord()
      It searches for all solutions. It does not record them and prints every tenth of them.
      Returns:
      true if any solution was found, false otherwise.
    • main

      public static void main(String[] args)
      It executes the program to create a model and solve crossword problem.
      Parameters:
      args - no arguments used.