Best of Jokes Current Jokes RHF Home Search Sponsor RHF?
Fun Stuff & Jokes
Previous | RHF Joke Archives | Next

Forgive me, Dijkstra...

okunewck@gondor.UUCP (Philip E. OKunewick)
(original, maybe)

-------------------------------- cut here -------------------------------------
	   I originally wrote this as a parody of a final paper for a Data
   Structures class.  It was published in rec.humor a few years back, with
   very positive responses.  Now, I know you don't like to repost old humor.
   However, since it's original I figured what th' heck - let's submit it to
   rec.humor.funny.
-------------------------------- cut here -------------------------------------

                 GRAPH THEORY AS APPLIED TO MOUSE MAZES


    A mouse maze can be viewed as a graph problem.

    In travelling the maze, the mouse enters the maze and has a choice of
directions to go.  He can either follow one of the open passages or walk
into a wall.  This is a very effective way of finding stupid mice.  If the
mouse does not walk into a wall, he chooses a path and follows it to the
next bend.  Once again, the mouse is given a choice of passages or the
oportunity to walk into a wall.

    In this manner, the mouse follows the maze until he finds the his way
out.  Tracing the mouse's footsteps and droppings will give a path from the 
entrance to the exit.  Although this may not be the shortest path, it will
definitely be a correct one.  

    We will disallow the possibility for the mouse to get fed up with the
whole damn thing and chew his own exit.  Our experimental mouse has no front
teeth. 


    Now, an algorithmic approach to the problem:

    Define every intersection or bend in a passage as a node, and define the
direction and distance to the next node as a link with a given cost.  (The
cost in this case is the length of the passage to the corner or next node.)  

    We apply Dijkstra's Shortest Path Algorithm...

    Our virtual mouse enters the maze-graph.  He has a choice of several
directions to go.  So he goes in those directions.  One virtual mouse goes
this way.  Another goes that way.  The other walks into the wall, bumps his
nose, and ceases to exist.

    Now, our virtual mouse is three. (two.)  This is a little hard to
fathom, until one considers that the mouse is virtual and therefore does not
exist.

        Proof:
                Quantity of mice = 0 
                Virtual mouse splits into three.
                3 times 0 mice = 0 mice

                Initial quantity = Final quantity = 0

                    5
                  W  ,    Q.E.D.


    We now have our 3 virtual mouse in the maze-graph, which was reduced to
a 2 virtual mouse because one of him ran into a wall and ceased to exist.
Following the algorithm, we look at our shortest path mouse which has reached
a node by now.  He splits into 3 more and the algorithm continues.

    Dead ends are to be treated as nodes with three walls.  He splits into
3, walks into all the walls at once, bumps his noses, and ceases to exist.
Meanwhile, he continues on his merry way in another part of the maze-graph.

    As the mouse runs into nodes that he's visited before, he has a very hard
time dealing with it, since he was never there to begin with anyway.
Therefore, unable to cope with our pseudo-reality, he chooses that the proper
course of action is to cease to exist.  Which he does.

    Okay, we now have a virtual mouse doing a very effective job of exploring
the maze.  He will eventually reach the exit, if a path indeed exists to it.
At this point the victor leaves the maze.  The shortest path through the maze
can be found by retracing his virtual footsteps and virtual droppings.  The 
rest of hims can either continue until they all reach dead ends or previously
visited nodes.

    An alternative possibility is for him to start squealing as soon as he
finds his reward.  (I have no idea what his reward may be, since I do not
know what virtual mice eat.)  At this point he can hear himself outside the
maze and cannot cope with it.  Therefore, he ceases to exist.  The only
virtual mouse left is the one outside, since he is happily eating virtual
mouse food, and did not hear himself where he wasn't anyway.

    One can speculate that the shortest path may be a little hard to retrace
because of all the confusion that went on in there.  Well, I beg to differ.
You see, this is the same mouse that we started with, and we did not lose
any mice in the process (0 mice - 0 mice = 0 mice, Q.E.D.)  The mouse that
came in is the same one that went out, and he took the shortest path to get
there.  There never were any other mice, so how could they have left a trail
of you-know-whats?  As far as this one goes, anyone who has had experience
with mice KNOWS that they leave trails.  The nice thing about it is that
their trails don't really exist, and give off no odor and are very easy to
clean up.



    Coming Soon:  Virtual Cats.


(From the "Rest" of RHF)


Previous | RHF Joke Archives | Next

Best of Jokes | Current Jokes | RHF Home | Search