Intelligent water drops algorithm