Você está na página 1de 2

Artificial Intelligence: Assignment

1. An intelligent vacuum cleaner travels in the 10x10 grid shown in Figure 1.Each cell in the grid is denoted
by C(i, j), where i is the row number and j is the column number. C(1, 1) is the bottom left corner of the
grid. The dark cells represent obstacles. Only vertical and horizontal movements are allowed. The cost of
vertical movement from 1 cell to another cell is 2 and that of two horizontal cells is 1. Write a program in
MATLAB or SWI-Prolog to generate a path between a given start cell to a goal cell using A algorithm.

Figure 1: 10x10 Grid

2. It is a dark night and there is a family of 5 that needs to cross a bridge suspended over a deep valley. The
only light available was a lamp which could only burn for 30 minutes. Up to two members can cross each
time. Different members take different amount of time to cross and the time they take must be at the pace
of the slower one. The time taken for each member is as shown:

(a) (G)Grandpa - 12 mins


(b) (F)Father - 8 mins
(c) (M)Mother - 6 mins
(d) (S)Sister - 3 mins
(e) (B)Brother - 1 min

For example, if the father and the grandpa were to cross together, it would take 12 minutes, leaving 18
minutes for one of them to return and get the rest moving. Write a program in MATLAB, C, Java or SWI
Prolog to give a plan to cross the bridge with minimum time.

3. A valuable gem is found to be missing from a museum. Two laborer women Neela, Kanthi and two security
guards Sunil and Kumara were taken into custody on suspicion. Followings are the statements made by
them.
Kumar: Im innocent. The Kanthi was cleaning the gem cabinet
Kanthi: Im innocent. I did not clean the gem cabinet
Sunil: Im innocent. Neela has stolen the gem.
Neela: Im innocent. One of the men has stolen the gem
Write a program in SWIprolog to find who has stolen the gem.

1
4. The lecturer teaching AI has taken a decision to give Six assignments to the students on group basis.
The six assignments are on Informed Search, Uninformed Search, Genetic algorithms, Logic, Fuzzy Logic
and Classification. One group code named Lazy Bunch with six students (three females named Erandi,
Jayanthi, and Kumari, and three men named Dilshan, Himal, and Lalith) approached the lecturer with
usual complain that the work load is very heavy. So, the lecturer decided to assign the six assignments to
the group such that each student do only one assignment. However, the students were not happy with way
the lecturer assigned the assignments and each of the six students decided to change his or her to a different
assignment.

(a) No pair of students exchanged assignments (i.e. If Assignment of Kumari is given to Erandi, Erandis
assignment cannot be given to Kumari)
(b) If Kumari is from Anuradhapura, then the student who gave the assignment to the student from
Colombo has accepted the assignment assigned to the one from Puttalam.
(c) If Kumari has accepted the assignment assigned to the one from Puttalam, then then the student who
gave the assignment to the student from Colombo is from Anuradhapura
(d) A male student decided he wanted to do Fuzzy logic assignment.
(e) Erandi didnt take the assignment assigned to Lalith.
(f) The one from Mathugama has decided to do Logic assignment.
(g) Lalith didnt end up with the assignment of the student from Colombo.
(h) Genetic algorithms assignment is assigned to Lalith either initially or finally.
(i) The student who gave his or her assignment to the student from Colombo received the assignment
assigned to either Erandi or Himal.
(j) Kumari ended up with Dilshans assignment.
(k) The student who gave his or her assignment to Jayanthi ended up with the assignment originally
assigned to the student from Dehiwala.
(l) The student from Colombo was originally assigned the Fuzzy logic assignment.
(m) The student from Kandy and the student who will be doing Informed Search assignment arent of the
same gender.
(n) Himal is not from Dehiwala.
(o) Himal will be taking an assignment other than Fuzzy logic.
(p) Himals assignment wasnt originally assigned to Lalith.
(q) The Student from Puttalam either started or ended with the Uninformed search assignment.

Write a program in SWI-Prolog to solve the above problem.

Assignment Due Date: 15/02/2015


Submission Method:

(a) Archive all the solutions into a rar file


(b) Name the file as PGIS BatchNumber RegNumber.rar (Example: PGIS 13 12.rar)
(c) Email it to jan@ee.pdn.ac.lk with subject PGIS AI Assignment 2014

Você também pode gostar