  Ancestral graphs can encode conditional independence relations that arise in
directed acyclic graph (DAG) models with latent and selection variables.
However, for any ancestral graph, there may be several other graphs to which it
is Markov equivalent. We state and prove conditions under which two maximal
ancestral graphs are Markov equivalent to each other, thereby extending
analogous results for DAGs given by other authors. These conditions lead to an
algorithm for determining Markov equivalence that runs in time that is
polynomial in the number of vertices in the graph.
