Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: Goto algorithm with priority queues
Home

[Freeciv-Dev] Re: Goto algorithm with priority queues

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Goto algorithm with priority queues
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Thu, 8 Jun 2000 20:46:09 +0200

On Thu, 08 Jun 2000, Falk Hueffner wrote:
> 
> Hi,
> 
> here's a demonstration of a goto algorithm using priority queues. It
> is reasonably fast for my test cases. It finds an optimal path from a
> certain point on the map to all others (but only one). I really tried
> hard to make the code readable, so please tell me if someting is
> unclear...
> 
> The file is a self contained .c file for testing purposes. Before
> trying to optimize it further, it really would need to be integrated
> first to have reasonable test cases.
> 
>       Falk

I don't see why you didn't code it straight into freeciv; that patch look
like alot more work than a direct insertion would have taken. :)

Hmm; lots of logaritmic time. I think it can be done in constant time by
limiting maxcost and using a little extra memory. (for our purposes).
Darn, now I'll have to make a patch to prove it... :)

-Thue



[Prev in Thread] Current Thread [Next in Thread]