A Decomposition-Based Implementation of Search Strategies(13)
发布时间:2021-06-12
发布时间:2021-06-12
Search strategies, that is, strategies that describe how to explore search trees, have raised much interest for constraint satisfaction in recent years. In particular, limited discrepancy search and its variations have been shown to achieve significant imp
DecompositionforSearchStrategies 363
BoolILDSSATISFY(Goalg,Storeσ){
for(d:=0;d<=MaxDiscrepancies;d++)
ifILDSEXPLORE(g,σ,d)thenreturntrue;
returnfalse;
}
BoolILDSEXPLORE(Goalg,Storeσ,intd){
fd>=0then{
ifSUCCESS(σ)thenreturntrue;
elseifFAILURE(σ)thenreturnfalse;
else{
<(gl,cl),(gr,cr)>:=BRANCH(g,σ);
TELL(σ,cl);
ifILDSEXPLORE(gl,σ,d)thenreturntrue;
BACKTRACK(σ);
TELL(σ,cr);
ifILDSEXPLORE(gr,σ,d-1)thenreturntrue;
BACKTRACK(σ);
returnfalse;
}
}elsereturnfalse;
}
intILDSMIN(Goalg,Storeσ,Exprf){
f :=∞;
for(d:=0;d<=MaxDiscrepancies;d++)
ILDSMINIMIZE(g,σ,f,f ,d);
returnf ;
}
voidILDSMINIMIZE(Goalg,Storeσ,Exprf,inoutintf ,intd){
fd>=0then{
ifSUCCESS(σ)then
f :=EVAL(f,σ);
elseifnotFAILURE(σ)then{
<(gl,cl),(gr,cr)>:=BRANCH(g,σ);
TELL(σ,cl∧f<f );
ILDSMINIMIZE(gl,σ,f,f ,d);
BACKTRACK(σ);
TELL(σ,cr∧f<f );
ILDSMINIMIZE(gr,σ,f,f ,d-1);
BACKTRACK(σ);
}
}
}
Fig.5.AniterativeimplementationofLDS.
ACMTransactionsonComputationalLogic,Vol.5,No.2,April2004.
上一篇:高职院校学生“资助育人”新模式
下一篇:复合风管制作方法