[SciPy-dev] Advice on Simulated Annealing (ticket #875)

josef.pktd@gmai... josef.pktd@gmai...
Mon Mar 2 05:53:29 CST 2009


On Mon, Mar 2, 2009 at 12:55 AM, Stéfan van der Walt <stefan@sun.ac.za> wrote:
> Hi,
>
> Is there anyone here who has some experience with simulated annealing?
>
> The code at
>
> http://scipy.org/scipy/scipy/ticket/875#comment:1
>
> looks fragile, but I don't know how to fix it best.
>
> Thanks
> Stéfan

I had looked at this ticket briefly, and, I think, following his
suggestion of building the random array xt incrementally should not
affect any other code and speed up finding a random array inside the
bounds.

The elements of xc are independently drawn, so in each iteration only
those values, for which indu or indo are true, have to be replaced,
and successfull draws can be kept. xc can be drawn for the full array
and partially discarded, since this is cheap.

something like this (use correct `or` and initialize indu and indo for
first iteration) should work

xt[indu or indo] = x0[indu or indo] + xc[indu or indo]


Josef


More information about the Scipy-dev mailing list