# Agreement forest

In the mathematical field of graph theory, an agreement forest for two given (leaf-labeled, irreductible) trees is any (leaf-labeled, irreductible) forest which can, informally speaking, be obtained from both trees by removing a common number of edges.
Agreement forests first arose when studying combinatorial problems related to computational phylogenetics, in particular tree rearrangements.

## Preliminaries

Recall that a tree (or a forest) is irreductible when it lacks any internal node of degree 2. In the case of a rooted tree (or a rooted forest), the root(s) are of course allowed to have degree 2, since they are not internal nodes. Any tree (or forest) can be made irreductible by applying a sequence of edge contractions.
An irreductible (rooted or unrooted) tree T whose leaves are bijectively labeled by elements of a set X is called a (rooted or unrooted) X-tree. Such a X-tree usually model a phylogenetic tree, where the elements of X (the taxon set) could represent species, individual organisms, DNA sequences, or other biological objects.
Two X-trees T$_1$ and T$_2$ are said to be isomorphic when there exists a graph isomorphism between them which preserves the leaf labels. In the case of rooted X-trees, the isomorphism must also preserves the root.
Given a X-tree T and a taxon subset Y ⊆ X, the minimal subtree of T that connects all leaves in Y is denoted by T(Y). When T is rooted, then T(Y) is also rooted, with its root being the node closest to the original root of T. This T(Y) subtree needs not be a Y-tree, because it might not be irreductible. We therefore further define the restricted subtree T|Y, which is obtained from T(Y) by suppressing all internal nodes of degree 2, yielding a proper Y-tree.

## Agreement forests

An agreement forest for two unrooted X-trees T$_1$ and T$_2$ is a partition {X$_1$, X$_2$, ..., X$_k$} of the taxon set X satisfying the following conditions:
* T$_1$|X$_i$ and T$_2$|X$_i$ are isomorphic for every i ∈ {1,2,...,k} and
* the subtrees in { T$_1$(X$_i$) : i ∈ {1,2,...,k} } and { T$_2$(X$_i$) : i ∈ {1,2,...,k} } are vertex-disjoint subtrees of T$_1$ and T$_2$, respectively.
The set partition {X$_1$, X$_2$, ..., X$_k$} is identified with the forest of restricted subtrees F = {T|X$_1$, T|X$_2$, ..., T|X$_k$}, with either T=T$_1$ or T=T$_2$ (the choice of it begin irrelevant because of condition 1). Therefore, an agreement forest can either be seen as a partition of the taxon set X or as a forest (in the classical graph-theoretic sense) of restricted subtrees.
The size of an agreement forest is simply its number of components. Intuitively, an agreement forest of size k for two phylogenetic trees is a forest which can be obtained from both trees by removing (k-1) edges in each tree and subsequently suppressing internal nodes of degree 2.

### Acyclic agreement forests

A raffinement on the above definition can be made, resulting in the concept of acyclic agreement forest. An agreement forest F for two X-trees T$_1$ and T$_2$ is said to be acyclic if each of its tree components can be numbered in such a way that if the root of one component X$_i$ ∈ F is an ancestor of the root of another component X$_j$ ∈ F in either T$_1$ or T$_2$, then the number assigned to X$_i$ is lower than the number assigned to X$_j$ .
Another characterization of acyclicity in agreement forest is to consider the directed graph G$_F$ that has vertex set F and a directed edge (X$_i$, X$_j$) if and only if i ≠ j and at least one of the two following conditions hold:
* the root of T$_1$(X$_i$) is an ancestor of the root of T$_1$(X$_j$) in T$_1$
* the root of T$_2$(X$_i$) is an ancestor of the root of T$_2$(X$_j$) in T$_2$
The directed graph G$_F$ is called the inheritance graph associated with the agreement forest F, and we call F acyclic if G$_F$ has no directed cycle.

## Optimization problems

A (rooted, unrooted, acyclic) agreement forest F for T$_1$ and T$_2$ is said to be maximum if it contains the smallest possible number of elements (i.e. it has the smallest size). In this context, it is the agreement between the two trees which is maximized: it explains why computing a maximum agreement forest actually means minimizing its number of components. This leads to two different (but related) optimization problems. In both cases, we choose to minimize |F| − 1 rather than |F|, because the former corresponds to the number of cuts to be done in each tree in order to obtain F.
* maximal ≠ maximum
* unrooted MAF corresponds to TBR
* rooted MAF corresponds to rSPR
* acyclic MAF corresponds to HYB
* AFs can be defined on non-binary trees
* AFs can be defined on more than two trees
* acyclic agreement forests have a role to play in the computation of HYB on 3 or more trees, but the relationship is much weaker than in the case of 2 trees
* Complexity
* FPT algorithms
* Approximation algorithms
* Exponential time algorithms