I am writing code to address the Nurse Restoring Problem
I have implemented Simulated Annealing and I am interested in comparing the results to Late Acceptance Hill Climbing
I have found some pseudo code for Late Acceptance but need a little help to write it in Java:
Produce an initial solution s
Calculate initial cost function C(s)
Set the initial number of steps I=0
For all k in ( 0.. L-1 ) C_hat[k]=C(s)
Do until a stopping condition
Construct a candidate solution s*
Calculate its cost function C(s*)
v = I mod L
If C(s*) <= C_hat[v]
Then accept s*
Insert cost value into the list C_hat[v] = C(s)
Increment a number of steps I=I+1
End do
I really don't get this bit: For all k in ( 0.. L-1 ) C_hat[k]=C(s)
The pseudo code is from http://www.yuribykov.com/LAHC/LAHC_wonders.pdf