Presentation is loading. Please wait.

Presentation is loading. Please wait.

Artificial Intelligence Tutorials

Similar presentations


Presentation on theme: "Artificial Intelligence Tutorials"— Presentation transcript:

1 Artificial Intelligence Tutorials

2 Tutorial # 5

3 Q1 – Problem Formulation
Variables D1, D2, D3, D4, D5, D6 Domain D1 Domain = {P, M, M, M, CS, CS} D2 Domain = {P, M, M, M, CS, CS} D3 Domain = {P, M, M, M, CS, CS} D4 Domain = {M, M, M, CS, CS} D5 Domain = {M, M, M, CS, CS} D6 Domain = {M, M, M, CS, CS} Constraints D1 <> D2 D1 <> D4 D2 <> D5 D2 <> D3 D3 <> D6 D5 <> D6 D5 <> D4 Solution M P M Cs M Cs Their might be other solutions: 1= to represent the variables with the type of the student and assign them to a desk. 2= to put the domain as Di = {P, M, M, M, CS, CS} where i={1…6}, but then you will have to add a constraint as D4<>p, D5<>p, D6<>p.

4 Q2 – AC3 (A,B) --- Queue A {1,2,3,4,5} B C D Added Q AB {2,3,4,5} CA
BA {1,2,3,4} DB AC {2,3,4} {3,4,5} DC CD --- BD {1,2,3}

5 Q2 –Forward Checking (C)
Forward checking with MRV heuristic…

6 Q3 – Definitions A constraint satisfaction problem: is a problem in which the goal is to choose a value for each of a set of variables in such a way that the values all obey a set of constraints. A constraint: is a restriction on the possible values of two or more variables. For example, a constraint might say that A = a is not allowed in conjunction with B = b. Backtracking search: is a form depth-first search in which there is a single representation of the state that gets updated for each successor, and then must be restored when a dead end is reached. Arc consistency: a directed arc from variable A to variable B ( Arc AB ) in a CSP is consistent if, for every value in the current domain of A, there is some consistent value of B.

7 Q4 – No. of Solutions for Map Coloring
There are 18 solutions for coloring Australia with three colors. Start with SA, which can have any of three colors. Then moving clockwise, WA can have either of the other two colors, and everything else is strictly determined. That makes 6 possibilities for the mainland, times 3 for Tasmania yields 18. 3 * 2 * 1 *1 * 1 * 3 = 18

8 Q5 – Formulations of Crossword Puzzle
General Search Problem State Any arrangement of n words on the puzzle. Initial Sate No words on puzzle. Successor Function Fill a word in the puzzle with one of the words in dictionary. Goal Fill all the words in the puzzle. Path Cost Each fill cost 1. Solution Crossword puzzle construction can be solved many ways. One simple choice is depth-first search. Each successor fills in a word in the puzzle with one of the words in dictionary. It is better to go one word at a time, to minimize the number of steps.

9 Q5 – Formulations of Crossword Puzzle
CSP Problem : As a CSP there are even more choices. You could have… Variable: Each box in the crossword puzzle. Value of each variable: A letter. Constraints: The letters must make words.

10 Q5 – Formulations of Crossword Puzzle
CSP Problem : As a CSP there are even more choices. Alternately, we could have… Variable: Each string of consecutive horizontal or vertical boxes. Domain of the variables: Words in the dictionary of the right length. Constraints: Two intersecting words must have the same letter in intersecting box. Solving a problem in this formulation requires fewer steps, but the domain are larger (assuming a big dictionary) but there are fewer constraints.


Download ppt "Artificial Intelligence Tutorials"

Similar presentations


Ads by Google