~~~~~~~~~~NO CODE - OTHER SOLUTIONS ARE INCORRECT ON answers - FOL ONLY!!!!!!~~~~~~~~~~
Posted: Fri Jul 08, 2022 6:37 am
~~~~~~~~~~NO CODE - OTHER SOLUTIONS ARE INCORRECT ON answers - FOLONLY!!!!!!~~~~~~~~~~
Question 5: 30 Marks Consider the crossword puzzle provided in Figure 2. U Figure 4: Crossword Puzzle It is possible to represent the problem of generating puzzles as a CSP. Suppose you are given the puzzle grid as above, as well as a dictionary W of words to use for generating the puzzle. The variables for this problem is easily represented as the collection of vertical or horizontal cells. Sucha collection is called a box. A horizontal box is identified as A, with i being the number of the box, and a vertical box is D, with j being the number of the box. Boxes consisting of only one cell is not allowed. Suppose you are given the following functions: 1. BLen(1): returns the number of cells that a box contains, for example BLen(A₁) = 4 2. WLen(n): returns the length of a word n, for example WLen(hi) = 2 3. Cell(v, n): returns the letter in cell n of variable v. For example, if A₁ = 'Ahoy', then Cell (A₁, 2) = 'h'.
Answer the following questions. (5.1) Provide the variables for this problem. Make sure to use the correct notation (5.2) Define the domain for the variables, make sure to use the correct notation, and to use all the information provided. (Hint: Remember that the number of cells in a box and the number of letters in a word must match.) (5.3) Define the constraints for this problem. (5.4) You are given the following list of words as your dictionary. W = GAB, WIN, VAN, VET, GET, GIVE, GRAB, GROW, DRUM, BEND, BARE, DRAB, DRAG, EYES, FEEL, FOOL, EELS, ERRS, TARDY, BARES, EARLY, DUMPS, FEELS, DRUMS} Use the Minimum Remaining Values (MRV) heuristic to generate the crossword, applyarc- consistency when you've made an assignment to a variable.
Question 5: 30 Marks Consider the crossword puzzle provided in Figure 2. U Figure 4: Crossword Puzzle It is possible to represent the problem of generating puzzles as a CSP. Suppose you are given the puzzle grid as above, as well as a dictionary W of words to use for generating the puzzle. The variables for this problem is easily represented as the collection of vertical or horizontal cells. Sucha collection is called a box. A horizontal box is identified as A, with i being the number of the box, and a vertical box is D, with j being the number of the box. Boxes consisting of only one cell is not allowed. Suppose you are given the following functions: 1. BLen(1): returns the number of cells that a box contains, for example BLen(A₁) = 4 2. WLen(n): returns the length of a word n, for example WLen(hi) = 2 3. Cell(v, n): returns the letter in cell n of variable v. For example, if A₁ = 'Ahoy', then Cell (A₁, 2) = 'h'.
Answer the following questions. (5.1) Provide the variables for this problem. Make sure to use the correct notation (5.2) Define the domain for the variables, make sure to use the correct notation, and to use all the information provided. (Hint: Remember that the number of cells in a box and the number of letters in a word must match.) (5.3) Define the constraints for this problem. (5.4) You are given the following list of words as your dictionary. W = GAB, WIN, VAN, VET, GET, GIVE, GRAB, GROW, DRUM, BEND, BARE, DRAB, DRAG, EYES, FEEL, FOOL, EELS, ERRS, TARDY, BARES, EARLY, DUMPS, FEELS, DRUMS} Use the Minimum Remaining Values (MRV) heuristic to generate the crossword, applyarc- consistency when you've made an assignment to a variable.