  Counting and uniform sampling of directed acyclic graphs (DAGs) from a Markov
equivalence class are fundamental tasks in graphical causal analysis. In this
paper, we show that these tasks can be performed in polynomial time, solving a
long-standing open problem in this area. Our algorithms are effective and
easily implementable. Experimental results show that the algorithms
significantly outperform state-of-the-art methods.
