Dancing links is a link-based data structure that supports efficient DFS for some combinatorial search problems (Details are shown in (Knuth, 2019)).
we found that using a simple array-based representation is sufficient since the conditional probability evaluation consumes most of the time.