Library for local search and some applications