Luby序列

Luby序列之于SAT求解器的应用,主要在重启策略上:

Luby重启定义一个代表冲突数的间隔序列,每当达到序列中规定数量的冲突时,停止当前搜索,重新构造决策树

 

Luby序列公式如下:

 

 

 

Luby序列生成代码如下:

/*
  Finite subsequences of the Luby-sequence:

  0: 1
  1: 1 1 2
  2: 1 1 2 1 1 2 4
  3: 1 1 2 1 1 2 4 1 1 2 1 1 2 4 8
  ...
*/ static double luby(double y, int x){ // Find the finite subsequence that contains index 'x', and the // size of that subsequence: int size, seq; for (size = 1, seq = 0; size < x+1; seq++, size = 2*size+1); while (size-1 != x){ size = (size-1)>>1; seq--; x = x % size; } return pow(y, seq); }

其中x为序列索引,y为底数。

例如:

当 y = 2, x ∈ [0, 16),Luby序列如下: 

 

 当 y = 10, x ∈ [0, 16),Luby序列如下: 

 

 

若想扩大序列间隔,则右乘扩大系数:

int nof_conflicts = luby(restart_inc, curr_restarts) * restart_first;

 

posted on 2021-03-04 10:12  QzZq  阅读(368)  评论(0)    收藏  举报

导航