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,
If anybody is intrested, I can give a more detailed description…
–
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
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.
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.