Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Reg.

# _______________Section ________ Name _________________________

Department: Computer Engineering Program: B.E (CE)

Assignment 2
CE-415 Artificial Intelligence

Announced date: 22-Mar-2021__ Due Date:2-Apr-2021___ Total Marks = 1


Marks Obtained =
Teacher Name: Dr. Shaheena Noor, Mr. Saqib Hussain Siddiqui, Ms. Mahjabeen Tahir

Sr. No Course Learning Outcomes PLOs Blooms


Taxonomy
CLO_2 Implement classical artificial intelligence techniques PLO_2 C3 (Applying)

Question No. 1:
Following is a graph of a search problem, where the directed arcs represent the successors of a
node. The cost of moving to a node is given by the number on the arc. The value of the heuristic
function h is shown inside each node. The start state is S and the goal is G. Use the following
search strategies, state the order in which states are expanded (i.e., when they are removed from
the frontier), as well as the final path returned when the search is finished.
Search Strategies:
1. Breadth-First Search
2. A* search
Assume that all ties are resolved in alphabetical order (i.e., the A state is expanded before the B
state which is expanded before the C state, etc.). Solve the following with respect to above
mention search strategies:
a. Order in which states are expanded
b. Resulting path found by the search algorithms
c. Cost of the resulting path

Question No. 2:
Consider the following fitness function:
fitness (bitstring) = number of 1’s in the bitstring where both adjacent bits are 0’s.
E.G: fitness (“010110100”) = 2; fitness (“100011011”) = 0; fitness (“010101010”) = 4. (Notice
that 1’s in the first or last position in the string is not counted in the fitness function, even if
adjacent to a 0.)

1
Apply genetic algorithm by considering the following steps:
1. Create an initial population containing 4 random 9-bit strings.
2. Discard the 2 least-fit ones (break ties randomly).
3. Do a single-point cross-over using the 2 most fit. The 2 children that result and their
parents constitute the next generation.
4. Randomly mutate 1 bit in 1 string in the population.
5. Go to step 2
Begin with the initial population and show what will the next two (2) generations look be.

Question No. 3:
Consider a scenario in which Mars rover that has to drive around the surface, collect rock
samples, and return to the lander. Formulate the problem and construct a plan for its exploration.

• It has batteries. The batteries can be charged by stopping and unfurling the solar collectors
(pretend it’s always daylight). One hour of solar collection results in one unit of battery charge.
The batteries can hold a total of 10 units of charge.

• It can drive. It has a map at 10-meter resolution indicating how many units of battery charge
and how much time (in hours) will be required to reach a suitable rock in each square.

• It can pick up a rock. This requires one unit of battery charge. The robot has a map at 10-meter
resolution that indicates the type of rock expected in that location and the expected weight of
rocks in that location. Assume only one type of rock and one size can be found in each square.

The objective for the rover is to get one of each of 10 types of rocks, within three days, while
minimizing a combination of their total weight and the distance traveled. You are given a
tradeoff parameter α that converts units of weight to units of distance. The rover starts at the
lander with a full battery and must return to the lander. Here is a list of variables that might be
used to describe the rover’s world:
• types of rocks already collected
• current rover location (square on map)
• current lander location (square on map)
• weight of rocks at current location (square on map)
• cost to traverse the current location (square on map)
• time since last charged
• time since departure from lander
• current day
• current battery charge level
• total battery capacity
• distance to lander
• total weight of currently collected rocks

Question No. 4:
Consider the graph shown in the figure below. We can search it with a variety of different
algorithms, resulting in different search trees. Each of the trees (labeled G1 though G7) was
generated by searching this graph, but with a different algorithm. Assume that children of a node

2
are visited in alphabetical order. Each tree shows all the nodes that have been visited. Numbers
next to nodes indicate the relevant “score” used by the algorithm for those nodes. For each tree,
show or indicate whether it was generated with:
1. Depth First Search
2. Breadth First Search
3. Uniform Cost Search
4. A* Search
5. Best-First (Greedy) search

In all cases a strict expanded list was used. Furthermore, if you choose an algorithm that uses a
heuristic function, say whether we used
H1: heuristic 1 = {h(A)=3, h(B)=6, h(C)=4, h(D)=3}
H2: heuristic 2 = {h(A)=3, h(B)=3, h(C)=0, h(D)=2}

Moreover, for all algorithms, say whether the result was an optimal path (measured by sum of
link costs), and if not, why not. Be specific and justify your answer.

¬*¬*¬*¬*¬*¬*¬*¬The End ¬*¬*¬*¬*¬*¬*¬*¬


3

You might also like