Research Article
Cutting Cycles of Conditional Preference Networks with Feedback Set Approach
Algorithm 1
Improved BFS Algorithm of CP-nets.
| Improved BFS Algorithm of CP-nets | | Input: A CP-net N | | Output: A acyclic CP-net N’ | | Ring node set DN | | Node SD | | Initial queue Q | | For every D | | Q=NULL | | IF D!=NULL | | For SD | | IF Son(S)D&&Parent(S)D | | Q.inesrt(S) | | End IF | | End for | | X=Rand()%sizeof(Q) | | (Parent(Q[X])D)=NULL | | IF Q==NULL | | For SD | | IF exist Parent(S)D | | Q.inesrt(S) | | End IF | | End for | | Y=Rand()%sizeof(Q) | | (Parent(Q[Y])D)=NULL | | End if | | End if | | End for |
|