swarm-modeling
[Top][All Lists]
Advanced

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

Re: Path algorithm


From: Matthew Aylward
Subject: Re: Path algorithm
Date: Fri, 2 Mar 2001 21:26:26 +0800 (WST)

Steve,
i have a few image processing algorithms that i have modified to work on
discrete2ds and grid2ds. The standard "flood fill" would achieve this,
what it does is recursively search adjoining cells for a particular
criteria. All that is needed to modify it is to add your
own "check_cell" function pointer similar to a quick sort "compare"
function. If the flood fill reaches the cell you want to check then there 
is an unbrocken path to it along which the criteria is met. You could set
it to break out of the search when the particular cell is reached.
you also need to decide between an 8-cell search neighbourhood which
considers diagonals to be a connection, or a 4-cell which only counts
horizontal or vertical connections.
If this sounds like it could be any use let me know and I will send you
the code. (It is at work and I'm writing this at home.)
Cheers,
Matt 

On Thu, 1 Mar 2001, M Lang / S Railsback wrote:

> I need an algorithm to see if you can get from one place in a Grid2D to
> another region of the grid.
> 
> Say there are a patch of connected grid cells that are "safe" for my
> fish. The other cells are either wet or dry, and the fish can only move
> through wet cells. I need to determine for each wet cell whether or not
> there is a connection through the other wet cells to the "safe" patch.
> 
> Does anyone have an efficient algorithm for this? 
> 
> Thanks
> 
> Steve
> -- 
> address@hidden
> Lang, Railsback & Assoc.
> 250 California Ave., Arcata CA 95521
> 707-822-0453; Fax 822-1868
> 
> Until July 1, 2001: 
>       Los Alamos, NM
>       505-661-4258
> 
> 
>                   ==================================
>    Swarm-Modelling is for discussion of Simulation and Modelling techniques
>    esp. using Swarm.  For list administration needs (esp. [un]subscribing),
>    please send a message to <address@hidden> with "help" in the
>    body of the message.
>                   ==================================
> 



                  ==================================
   Swarm-Modelling is for discussion of Simulation and Modelling techniques
   esp. using Swarm.  For list administration needs (esp. [un]subscribing),
   please send a message to <address@hidden> with "help" in the
   body of the message.
                  ==================================


reply via email to

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