Adds a density function and a LocalSearch approach.