Introduction to Artificial Intelligence
Homework #2
Due: Sept. 29
Contents
The Story
Rounding turn 3 at Le Mans, feeling my Porsche 962C rev up to 12000RPM,
and shifting into third gear, I quickly glanced into my rearview. My
mortal enemy, Price Cobb, in his annoying Jaguar XJR12, was still right
on my tail. With 23 hours and 59 minutes of this 24 hour endurance
contest under our belts, that sucker was still right behind me. Between
Derek Bell, my co-driver, and me, we'd held off the faster Jag team for
the entire race. But now, with one lap to go, the aging 10 year old
Porsche was starting to tire, and the nimble twin turbo and superior
braking power of the new Jaguar was beginning to worry me. I used every
trick not in the book to keep him from passing me, but it wasn't clear
I'd be able to hold out for long. The Mulsanne straight, 3.1 miles of
total flat out madness, was approaching. It would take about three
quarters of a mile for me to reach full speed, but once reached I would
have to hold it at 240 mph for over two miles. Ordinarily this was not
much of a problem, but an oil cooling line had broken loose from it's
mounting and was right under the throttle, flooring it put my foot in
contact with the 300 degree metallic line. My sneakers had already burned
through on the last lap, and I knew that this time it would be my foot
charring away. What the hell, this was Le Mans, after all. I came out
of the last turn, Price had dropped about a second behind due his
inability to master the chicane we just negotiated, and I was on the
throttle.
Of course, there was no way for me to block him now, and the quicker
Jag was up to speed before me, and easily made up that second.
Pulling out of my slipstream, Price made his move. I, on the other
hand, was nearly oblivious to this action, since I was screaming a
scream that would have impressed a banshee. When I saw the green and
red of the Jag begin to move past me, I realized that the race was on
the line. I wasn't prepared to sacrifice my foot and then take second
place. But his car was faster. My only chance was to get into
his slipstream, and let him pull me down the straight. I got behind
him, not more than an inch separating our cars at 250 mph. I was
gaining an extra 10 mph by letting him push the air out of the way.
The sound of the air buffeting against the cabin combined with my
primal screams was deafening. Suddenly, before I knew it, we were at
the end of the Mulsanne. I pulled out from behind the Jag, and
waited for Price to hit his brakes, at this point, my only chance was
to out-brake him in this turn. The consequences of messing up were
wrapping the 962 around the armco siding.
I was all over the brakes a full second after Price, and swept passed him
into the turn. Of course, I was a little inside the line, and my late
braking forced me to carry more speed than I desired into the turn. As
I drifted toward track out, I realized that I was going to drift off. I
quickly jerked the steering wheel and let up ever so much on the
throttle, just enough to bring the car a little sideways. The car went
way wide, off the track and I smacked the armco. I had positioned the
car perfectly, though, and the force of the impact was absorbed by the
entire side of the car, and I punched the throttle with all my might.
I got back on the track, still in front of Price, and spewing a cloud of
dust behind me. Just the finish line left. I fixed my
sights on it and took off. I should have paid more
attention, because that Jaguar with it's stinking engine was beside me
as we crossed the finish.
Pulling into the pits I learned that it had been ruled it a tie. The track
officials were coming over to discuss it. Price and I stool there, he
looking at my burning foot, I looking at the French track officials
as they approached. They handed us each a little piece of plastic
and said with a smile, ``the first one to finish this wins the race.''
I stared down at the piece of plastic, and smiled. It was a
15-puzzle. ``Why,'' I said to myself, ``I believe my cockpit computer
has a LISP interpreter...''
The Project
After driving for 24 hours, I'm too exhausted to write a LISP program,
and besides I must get my foot looked after. In this assignment, in
order to ensure my victory, you must:
- Modify the branch and bound program we wrote in class to use a
heuristic in the evaluation of a node (see the book, page 144, for the
A* algorithm). You may assume that part of the problem-specific code
is a function called heuristic that takes a node as an argument
and returns a number representing an estimation of the distance to a
solution from the node passed in.
- Modify the node data structure to represent a state of a 15-puzzle
game.
- Modify the problem specific part of the code to expand 15-puzzle
nodes.
- Implement the heuristic function. Note that at a minimum, it must
be able to recognize a solution state and return a 0.
In addition to the code and description for your heuristic, you must do
some analysis of its performance. Your analysis should include at
minimum answers to the following questions:
-
Roughly how many nodes are there in the solution tree (not counting
cycles), of the various initial boards? (in other words, how many
possible board configurations are there?)
-
How many nodes does your program visit? (`visiting' a node is adding it to the
open list)
-
Comment on the accuracy of your heuristic based on your answers to the
above questions. What other factors might be used in rating a
heuristic, and how does yours measure up?
-
Are there any particular board configurations which might fool your
heuristic (That is, make it falsely believe one path is better than another)?
-
Try varying the strength of your heuristic (ie use the same
heuristic, but multiply the value by some factor) - how does this affect
your results? What seems to be a proper range for the heuristic?
The most important part of this project is your analysis. Spend the
most time on this part. If your analysis is skimpy, your grade will be
skimpy.