Question

(Adapted from Russell and Norvig) Consider the problem of constructing crossword puzzles: fitting words into a...

(Adapted from Russell and Norvig) Consider the problem of constructing crossword puzzles: fitting words into a grid of intersecting rows and columns of squares. Assume that a list of words (i.e. dictionary) is provided, and that the task is to fill in the rows and columns with words from this list so that if a row intersects with a column, their intersecting square has the same letter. Formulate this problem as an assignment (constraint satisfaction) problem by specifying the variables, their domains of possible values, and the constraints.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A huge piece of the exploration on this undertaking revolved around the creation and refinement of the accompanying calculation for filling in a crossword matrix (under the character-based model depicted previously). It takes as info a lattice and a word list; with minor varieties, a similar calculation can be utilized either to settle a riddle (in which case the network is contribution with "stops" as of now set up, and the word list is (potentially a subset of) the lexicon) or to create a riddle arrangement (in which case the matrix is at first unfilled and the word list contains the words to fill into the framework).

Note that a subgrid, as utilized in the calculation, is a segment of the lattice space whose upper left square is the principal letter of the two its even and vertical words; the subgrid then reaches out to all squares which are a piece of words which converge either the flat or vertical word beginning from the underlying position.

  • Introduction: Set every one of the squares in the network to their unconstrained express, that is all character esteems are conceivable. (For comprehending purposes, this is A-Z; for age, A-Z in addition to a stop marker, for example, NUL.)
  • Rehash the accompanying for each subgrid:
  • For every one of the conceivable character estimations of the underlying (upper left) position, get all words from the word list which start with the given character, and which fulfill the length requirements for the down and crosswise over words, separately. On the off chance that there isn't something like single word which fulfills the length and beginning letter requirements for every one of the two words (that is, there must be no less than one legitimate crosswise over word and one substantial down word), move to the following character esteem. Something else:
  • For each character composed, keep up a reference to what word made it be written in.
  • In the event that anytime a letter can't be composed into a cell since it is never again a conceivable incentive for the cell, expel the present word from the matrix and continue to the following word.
  • Rehash the over two stages for the down words, beginning from the underlying position and moving descending.
  • Move to the cell to one side of the underlying position. For each character in the rundown of conceivable qualities, discover all words which meet the length and starting letter limitations (for example begin with the right letter and are the best possible length). Call this rundown words.
  • On the off chance that words is vacant, erase the present character from the rundown of conceivable qualities. Proliferate the cancellation in reverse and advances in the matrix by evacuating the word which made the erased character be written in. Rehash as fundamental; if a cell ever loses the majority of its conceivable qualities, end the calculation and return FAIL.
  • Write in every one of the word  as above. On the off chance that a letter must be composed into a cell for which it's anything but a conceivable esteem, expel the present word and engender the changes.
  • Rehash the above advance for each line of the lattice, for the length of the underlying down word. This ought to totally navigate the subgrid.
  • At the point when the sum total of what subgrids have been filled in, the matrix ought to contain a portrayal of every single imaginable arrangement. Yield it is possible that one or every conceivable arrangement utilizing one of any number of calculations for specifying the arrangements. (The framework comprises of a fallen tree of conceivable arrangements, with every cell speaking to all the conceivable qualities for that cell.)
Add a comment
Know the answer?
Add Answer to:
(Adapted from Russell and Norvig) Consider the problem of constructing crossword puzzles: fitting words into a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT