AC-3 in Artificial Intelligence: A Modern Approach
の擬似コードを読むと、パスの一貫性と弧の一貫性を解決すると思った。しかし、本書では、パスの一貫性はアルゴリズムPC-2
によって解決されると述べています。私は何か見落としてますか?AC-3はパスの一貫性を解決しますか?
AC-3
がパスの一貫性を解決するには不十分なのはなぜですか?
ここAC-3
function AC-3(csp) returns false if an inconsistency is found and true otherwise
inputs: csp, a binary CSP with components (X, D, C)
local variables: queue, a queue of arcs, initially all the arcs in csp
while queue is not empty do
(Xi, Xj)←REMOVE-FIRST(queue)
if REVISE(csp, Xi, Xj) then
if size of Di = 0 then return false
for each Xk in Xi.NEIGHBORS - {Xj} do
add (Xk, Xi) to queue
return true
function REVISE(csp, Xi, Xj) returns true iff we revise the domain of Xi
revised ← false
for each x in Di do
if no value y in Dj allows (x,y) to satisfy the constraint between Xi and Xj then
delete x from Di
revised ← true
return revised
のためのコードは、事前に感謝:)