| Direct_Causal_Learning(DCL) | |
| procedure remove_ parents(var PA); | |
| i = 0; | |
| repeat | |
| for each Y∈PA | |
| S = set of all sets A∈ PA{Y} such that | A|= i ; | // S contains the empty set Ø when i = 0; |
| A = first set in S; | |
| while A is not null and Y ∈ PA | // A is null if there are no sets in S. |
| B = A ∪ {Y}; | |
| if deleting some node from B increase score(B;Z) | |
| X = node whose deletion increases score the most; | |
| if Y = X | |
| remove Y from PA; | |
| endif | |
| endif | |
| A = next set in S; | // A is null if there are no sets left in S. |
| endwhile | |
| endfor | |
| i=i + 1; | |
| until | PA |≤ i or i > R; |