| Algorithm 1 Program dependency graph serialization algorithm PDG2Seq |
| Input: , , Output: Minimum graph serialization encoding |
|
1: initialization = (), i = 0; currentNode = v0; 2: for v in V do 3: v.visted = −1; 4: end for 5: DFSSearch (G, currentNode, ); 6: for e in E do 7: Find the insertion position in seq according to the rule ,Insert the backtracking edge e into seq; 8: end for 9: return seq 10: Subprocedure 1 DFSSearch (G, currentNode, seq) 11: currenINode.visited = i; 12: for nei in currentNode.neighbors do 13: array = () 14: for e in E do: 15: if e.begin == currentNode then 16: array.add (e) 17: end if 18: end for 19: e = min (Sort (array)); 20: if q.visited == −1 then 21: i + = 1; 22: E.remove (e); 23: seq.add (e); 24: DFSearch (G,q, seq); 25: end if 26: end for |