Optimisation of the WEAVE target assignment algorithm