Skip to main content
. Author manuscript; available in PMC: 2025 Aug 11.
Published in final edited form as: J Mach Learn Res. 2023;24:200.

Algorithm 2.

Tabu search

1: Input: data x, initial DAG 𝒒0, number of additionally allowed steps s, size of the tabu list t.
2: Compute BIC𝒒0∣x and set BICmax=BIC𝒒0∣x.
3: Set 𝒒*=𝒒max=𝒒0.
4: Initialize LastImprovement=0.
5: while LastImprovement<s do
6:  Initialize BIC*=∞.
7:  for all DAGs 𝒒′ reachable from 𝒒* by an edge addition, deletion, or reversal do
8:   if 𝒒′ does not reverse local moves in the tabu list, (i.e., in the last t steps) then
9:    Compute BICπ’’β€²βˆ£x.
10:    if BICπ’’β€²βˆ£x<BIC* then
11:     Set 𝒒*=𝒒′ and BIC*=BICπ’’β€²βˆ£x.
12:    end if
13:   end if
14:  end for
15:  if BIC*<BICmax then
16:   Set 𝒒max=𝒒* and BICmax=BIC*.
17:   Set LastImprovement=0.
18:  else
19:   Set LastImprovement=LastImprovement+1.
20:  end if
21: end while
22: Output: DAG 𝒒max.