Skip to main content
. 2022 Sep 24;24(10):1354. doi: 10.3390/e24101354
Algorithm 1. Construction algorithm of node order graph.
Constructing Node Order Graph Based on Edge Constraint
Input:SPG -Sparse parent node graph, GC -edge constraint graph
Output: G-Global optimal structure
1. PreviousLayer.HashTable←∅, PrevioUsLayer[∅].score←0, VC=variC
2. forLayer←1 to n do
3.     for each node U In the PreviousLyaer do
4.         Vr←Vc\U
5.         Gr← Removing variables of Vr And their relative arcs in Gc
6.         R← Root variables of Gr
7.             for each variable X∈V\U∪Vr∪R do
8.              [bestparents bestscore]←GetBestScoreX,U,C,SPG
9.            curscore←U.score+bestscore
10.               if NewLayer[U∪X] Is null
11.                NewLayer[U∪X]←curscore,parents,HashTable
12.             else if curscore > NewLayer[U∪X].score then
13.             NewLayer[U∪X]←curscore,parents,HashTable
14.             end if
15.          end for
16.     end for
17.    PreviousLayer←NewLayer
18.   end for
19.  G←querying PreviousLayer.HashTable