module Jumping:random jumps within the search spacesig
..end
based on an extension of "A Random Jump Strategy for Combinatorial Search" by Hantao Zhang.
based on the remaining time, or just every once in a while, a jump forward in the current search space is done, in order to increase the likelihood of finding a model, and not wasting all time in a deep fruitless branch.
to keep completeness, the search space positions jumped from are recorded as guiding paths. if the search space has been exhausted modulo jumped over parts, those are revisited by replaying the guiding paths in a non-redundant way.
the downsides of this approach are
typeconfig =
Config.config
typestatistic =
Statistic.statistic
typeliteral =
Term.literal
typestate =
State.state
typechoice_point =
State.choice_point
typebound =
Bound.bound
type
guiding_step =
| |
Left of |
(* | replay only the left split - this split was 'above' the destination of a random jump. i.e. it was not jumped over, and it (and its corresponding right split) was left in the search space after the jump. | *) |
| |
Right of |
(* | replay only the right split - the left split has been explored before the random jump, i.e. this was already a right split when the random jump happened. | *) |
| |
Split of |
(* | replay a full split decision - this split has been jumped over when doing the random jump, so it and its corresponding right split must still be explored. | *) |
typeguiding_path =
guiding_step list
type
jumping
val create : config ->
statistic -> state -> bound -> jumping
val jump : jumping -> choice_point option
val finished : jumping -> bool
val replay : jumping -> state -> guiding_path
state
, bound
, and the internal statistics.
returns the oldest recorded guiding path,
and removes it from jumping
.
Raises Not_found
if not guiding path is stored.
val guiding_path_to_string : guiding_path -> string