[GRASS-dev] Doubt regarding r.lake

I went through the code of r.lake, and found a few relevant things that might speed things up. I am hoping to get some brickbats and suggestions on this one.

Basic idea is to map the map as a binary image of 0 and 1
Do a connected component labelling of the image
Must be faster than regular O(n3) method that is given in the code.
The basic Idea I have is of using the temporary map to keep as a union find datastructure,

References

http://en.wikipedia.org/wiki/Connected_Component_Labeling#Two-pass

page 12 to 14 of http://www.cse.msu.edu/~stockman/Book/2002/Chapters/ch3.pdf

If anybody is intrested, I can give a more detailed description…
:slight_smile:

–
JYOTHISH SOMAN
MS-2008-CS
Center for Security, Theory And Algorithm Research (CSTAR)
International Institute of Information Technology
Hyderabad
India
Phone:+91-9966222626
http://www.iiit.ac.in/

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
George Bernard Shaw

Hi Jyothish,

On Mon, Jun 15, 2009 at 22:15, Jyothish Soman<jyothish.soman@gmail.com> wrote:

I went through the code of r.lake, and found a few relevant things that
might speed things up. I am hoping to get some brickbats and suggestions on
this one.

Sounds interesting. I'd like to hear more and I'm willing to test it.

--Wolf

--

<:3 )---- Wolf Bergenheim ----( 8:>

Me too :slight_smile:

Still IMHO r.lake isn't the worst performing module if it's running
with real world data (except for extra large maps).

Maris.

2009/6/16, Wolf Bergenheim <wolf+grass@bergenheim.net>:

Hi Jyothish,

On Mon, Jun 15, 2009 at 22:15, Jyothish Soman<jyothish.soman@gmail.com>
wrote:

I went through the code of r.lake, and found a few relevant things that
might speed things up. I am hoping to get some brickbats and suggestions
on
this one.

Sounds interesting. I'd like to hear more and I'm willing to test it.

--Wolf

--

<:3 )---- Wolf Bergenheim ----( 8:>
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev