Algorithm for searching the space of Gaussian directed acyclic