Research Article

Research on Dynamic Programming Strategy of Bayesian Network Structure Learning

Algorithm 2

The pseudocode of Step 4 in the BFSDP algorithm.
Input: The best parent sets of all nodes (), number of nodes (n), and best leaf node of each combination of nodes ().
Output: The optimal network structure (G).
Set , , , ;
For m=n to 1 in steps of −1 do
X = index of nodes in Hash Table, calculated by ;
Y = Leaf (X);
 The m-th position in order is set to be Y;
 The Y-th position in nodes is set to be 0;
 Set raw to be the best parent sets of Y, which is ;
G (raw, Y)  1;
End for
Return G