Research Article

Cutting Cycles of Conditional Preference Networks with Feedback Set Approach

Algorithm 2

A heuristic approach to FVS.
A heuristic approach to FVS
Input: A CP-net N
Output: A acyclic CP-net N’
Ring node set DN
Initial queue Q
For every DN
Q=NULL
IF D!=NULL
For S∈D
weight(S)=numSon(S)-numParent(S)
Q.inesrt(S)
End for
minWeight=min(weight(Q))
For i=1:Q.length
IF Q[i].weight==min(weight(Q))
P.insert(Q[i])
End IF
End FOR
IF P.length==1
Delete P[i]
Else IF son(S) D&&parent(S) D
Delete S
Else X=Rand()%sizeof(P)
Delete P[X]
End IF
End IF
End FOR
output a CP-net N’
End