|Maintainer||Richard Senington <firstname.lastname@example.org>|
Simple Neighbourhood functions for the representation of problems to the library. All neighbourhood functions must ultimately be of the form a->[a].
This module also contains some additional code for the modeling of problems and the link between the model and the library.
following helper function pinched from http:www.polyomino.f2s.comdavidhaskell/combinatorics.html
my code again from here on
The first type of neighbourhood is based upon combination exchange in a sequence of elements. This is appropriate for something like TSP, where order matters, but would be less useful for SAT.
It takes 2 numbers as parameters, one of which is the number of exchanges to perform, the other the maximum distance within the list. For example exchange 2 2, would change up to 2 elements in each neighbourhood, either adjacent or separated by 1 other element.
Some transformations (and the manual inspector of the search process) need to be able to extract a numeric price from a solution. To use these, the solution representation data type must be a part of the following class, please see the example code.