A connection between two nodes on a tree, modeled in DendroPy by the Edge class. A synonym for “branch” in the context of phylogenetic trees.
An edge connects a “tail node” (also called an origin or source node) to a “head node” (also called a target or destination node). The tail node is called the “parent” of the head node, while the head node is called the “child” of the tail node.
An edge is said to subtend or be incident to the node to which an edge connects, i.e., the head node. Conversely, the edges connecting a node to its children are called outgoing edges with respect to the tail node.
On a tree, every node has one and exactly one incident edge, and every edge has a head node. On the other hand, not every node may have outgoing edges (e.g, leaf nodes), and not every edge has a tail node (e.g., root nodes). As such, edges can be thought of “belonging” to their head nodes, due to this one-to-one relationship.
Edges can have any number of properties or attributes associated with them, representing a diverse range of phenomena, but the most important one is the edge length or weight.
The first or topmost node in a tree. This is also more commonly called the “root” or “root node” of the tree, though, in the strictest sense, this equivalence is only valid when the tree is explicitly rooted. Both rooted trees and unrooted trees have seed nodes. In rooted trees, the seed node is the root of the tree.
By definition, the seed node does not have a parent node. It is the node at which algorithms on the tree begin, since as a data structure, one can only pass from parent node to child nodes. If the tree is rooted, then the seed node is equivalent to the root of the tree.
A tree is a set of nodes connected to each other in parent-child relationships given by a set of edges. In DendroPy, a tree is modeled by the Tree class. A tree is a specialization of a graph, constrained such that:
- All its edges are directional.
- It has no directed cycles .
- The directionality is from the root (or “seed node” in DendroPy’s parlance) to the tips.
The first and second constraints alone result in a directed acylic graph . The addition of the third constraint results in an arborescence, which is strictly synonymous with “tree”.