Core library that implements the Neighbourhood Algorithm (Sambridge 1999, modified by Wathelet 2008).