# graphs – Changing a matrix to become an ancestry matrix

An ancestry matrix $$M$$ for rooted tree $$T$$ is defined as $$M(ij) = 1$$ iff node $$i$$ is an ancestor of node $$j$$. Suppose we are given a matrix $$X$$. We can easily check that if $$X$$ is compatible with some rooted tree(and create the tree) or not.
The question is if $$X$$ is not an ancestry matrix, how hard is the problem of modifying elements of $$X$$ so that it becomes an ancestry matrix.

Note: Stated problem can be seen as using hamming distance on the matrices. A related problem would be for what metrics on the matrices this problem can be solved eficciently?