lua-users home
lua-l archive

Re: Implementing the Dijkstra Algorithm

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > Thank you mate, I will start implementing it. The only think that 
> >will have to be diferent is how to mark when there is no edge between 
> >two nodes I will use -1, because 0 is a valid cost. :)
> 
> nil would be a good choice
Also for the INFs; actually, a no-edge should have distance INF, and so, just
substitute INFs by nils all together. It should be faster and makes more sense
in Lua.
Cheers,
luis.
-- 
A mathematician is a device for turning coffee into theorems.
 -- P. Erdos 
-- 
Luis Carvalho
Applied Math PhD Student - Brown University
PGP Key: E820854A <carvalho@dam.brown.edu>

AltStyle によって変換されたページ (->オリジナル) /