Re: non-recursive tracking algorithm (that works)

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 10/14/97


On Tue, 14 Oct 1997, Sean Butler wrote:

>Sometime ago, Jeremy Elson wrote:
>>Forgive me for not commenting it better; but I did write "now, do
>>classic BFS" assuming that anyone who wanted to know more would pick
>>up any algos or data structures book and read about how the BFS works.
>
>If you could have even mentioned that BFS stood for breadth-first search
>anywhere in the code, I could have looked it up easily.  If you don't know
>what BFS is, it's kind of hard to do much research on it.  I was probably

The fifth item down on an AltaVista search for "+BFS +algorithm" is:
http://www.cs.rpi.edu/~dugan/data_structures/mehta/lect12/lect12.html

Which contains one heading reading: Breadth First Search (BFS)

>neccesarily clumsy.  I think I was a bit peeved that it didn't work.  But

It usually works unless you have a !TRACK room in the way.  INDOOR rooms
should also be forbidden from tracking realistically.

>tracking, I mean I am 8 steps away in the same zone, and it doesn't work.

Often the mob is !TRACK, (try tracking a fido).

>By the way, recursion is expensive if its not tail or head recursion.
>Each successive call uses up another stack frame, do this too many times
>and its expensive both in time and memory.  A program only has so much
>stack.

The less variables you put on the stack, the less saving you have to do for
that recursion.  I put up to 7 mb on the stack before the program died
trying to do 8 mb.  I think that's much overkill for most people.

#include <stdio.h>
int main()
{
  char foo[7 * 1024 * 1024];
  printf("Ok.\n");
}

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST