Option S: Algorithms used in program balans

-S n:c1:c2

The argument consists of up to three parts, separated by a ':'.
examples: -S2, -S2:75, -S2:75:0.01, -S1:22.5:17.5, -S 0:11:50
The algorithm number n is mandatory. The interpretation of the optional numbers c1 and c2 depends on n. Currently three algorithms are defined, 0, 1 and 2.

-S0 selects the default fast algorithm, taking c1:c2 (default 1:2000) as the start and peak temperatures. So not specifying -S at all is equivalent to -S0:1:2000. The higher the temperature (T), the greater the likelihood that we temporarily accept an arrow switch that increases the sum of squares (= decreases Qf). Such an increase may be needed in order to find an even lower value later on. T=1 is so low that essentially only immediate improvements are accepted. By default we start there. Later on, when T reaches the peak value 2000, the search will move around much more freely, closer to a random walk. With -S0 the temperature goes quickly up and down, up and down, with only approximately 100 (super) iterations from peak to peak. Each super iteration tests hundreds or thousands of arrow switches.

-S1 selects slow exponential cooling (or heating) from temperature c1 to temperature c2. This algorithm should not be used for movements where the default -S0 easily finds the optimal Qf and spends the rest of the time optimising Qf1max/Qf1av/d4. -S0 is best for those. -S1 is targeted at cases where the best Qf is hard to find.
The default for c1:c2 is currently very crudely set to P:P/4 where P is the number of pairs in the movement. So for a 56 pair movement specifying -S1 is the same as -S1:56 and -S1:56:14.

-S2 selects slow adaptive ensemble cooling (or heating) from temperature c1 at approximately constant thermodynamic speed (proportional to) c2. The approximation is quite rough, but fast and simple, with the relaxation time being estimated by comparing time-sampled statistical figures for invidual ensemble members versus the ensemble as a whole. -S2 is essentially a slightly extended version of -S1 and thus again targeted at cases where the best Qf is hard to find.
The default for c1 (the start temperature) is 2000. The default for c2 (the speed) is 0.35*(P*r)1.361/iter with P = number of pairs, r = number of rounds, iter = number of iterations. So optimising a 56 pair 55 round movement for 15000 iterations (-s15000) with -S2 is the same as -S2:2000 and approximately the same as -S2:2000:1.31.

The default -S0 algorithm is always recommended for at least one or a few short runs before -S2 or -S1 is tried out for a few short runs too, perhaps 20000 iterations each. That makes it easier to guess a more useful temperature interval than the default for longer runs.
For -S1 the default end temperature is often too low, catching the search in a local optimum too early on and just wasting CPU without being able to escape after that. On rare occasions the default start temperature is too low too.
-S2 should be easier to tune than -S1 as long as you use an ensemble size of at least 6, but preferably 8 or 12 (or more; most efficiently a multiple of the number of available CPU cores). It's much less sensitive to the starting temperature. The default for that is very conservative and can usually be lowered to e.g. somewhere near the number of pairs without any harm, especially if combined with -z or a negative ensemble size (see option -s). Likewise a precise tuning of the speed isn't crucial either, as long as it's high enough and not many times higher than the ideal value. The default speed should be to the safe side, i.e. often somewhat higher than the optimal value (but sometimes indistinguishable from perfect).
After a moderately long -S1 or -S2 run, a further improvement can often be obtained by reheating from below to slightly above the temperature where the present solution was found. Fast improvements happen much less frequently when a solution found by -S0 is fed into balans. That's because the -S0 algorithm already includes such retries with reheating automatically, searching very intensely several times near non-transient new optima. A short -S0 run may also be used to harden the output of a long -S1/-S2 run.

Back to README