In graph theory, a division of mathematics, a median graph is an undirected graph in which every three vertices a, b, and c have a unique median: a vertex m(a,b,c) that belongs to shortest paths between each pair of a, b, and c. The concept of median graphs has long been studied, for instance by Birkhoff & Kiss (1947) or (more explicitly) by Avann (1961), but the first paper to call them "median graphs" appears to be Nebeský (1971). As Chung, Graham, and Saks write, "median graphs arise naturally in the study of ordered sets and discrete distributive lattices, and have an extensive literature". In phylogenetics, the Buneman graph representing all maximum parsimony evolutionary trees is a median graph. Median graphs also arise in social choice theory: if a set of alternatives has the structure of a median graph, it is possible to derive in an unambiguous way a majority preference among them. Additional surveys of median graphs are given by Klavžar & Mulder (1999), Bandelt & Chepoi (2008), and Knuth (2008).
Examples
Every tree is a median graph. To see this, observe that in a tree, the union of the three shortest paths between pairs of the three vertices a, b, and c is either itself a path, or a subtree formed by three paths meeting at a single central node with degree three. If the union of the three paths is itself a path, the median m(a,b,c)is equal to one of a, b, or c, whichever of these three vertices is between the other two in the path. If the subtree formed by the union of the three paths is not a path, the median of the three vertices is the central degree-three node of the subtree. Additional examples of median graphs are provided by the grid graphs. In a grid graph, the coordinates of the median m(a,b,c) can be found as the median of the coordinates of a, b, and c. Conversely, it turns out that, in every median graph, one may label the vertices by points in an integer lattice in such a way that medians can be calculated coordinatewise in this way.
Squaregraphs, planar graphs in which all interior faces are quadrilaterals and all interior vertices have four or more incident edges, are another subclass of the median graphs. A polyomino is a special case of a squaregraph and therefore also forms a median graph. The simplex graph κ(G) of an arbitrary undirected graph G has a vertex for every clique (complete subgraph) of G; two vertices of κ(G) are linked by an edge if the corresponding cliques differ by one vertex of G . The simplex graph is always a median graph, in which the median of a given triple of cliques may be formed by using the majority rule to determine which vertices of the cliques to include. No cycle graph of length other than four can be a median graph. Every such cycle has three vertices a, b, and c such that the three shortest paths wrap all the way around the cycle without having a common intersection. For such a triple of vertices, there can be no median.
Equivalent definitions In an arbitrary graph, for each two vertices a and b, the minimal number of edges between them is called their distance, denoted by d(x,y). The interval of vertices that lie on shortest paths between a and b is defined as I(a,b)={v∣d(a,b)=d(a,v)+d(v,b)}. A median graph is defined by the property that, for every three vertices a, b, and c, these intervals intersect in a single point:
For all a, b, and c, |I(a,b)∩I(a,c)∩I(b,c)|=1. Equivalently, for every three vertices a, b, and c one can find a vertex m(a,b,c) such that the unweighted distances in the graph satisfy the equalities d(a,b)=d(a,m(a,b,c))+d(m(a,b,c),b),d(a,c)=d(a,m(a,b,c))+d(m(a,b,c),c),d(b,c)=d(b,m(a,b,c))+d(m(a,b,c),c), and m(a,b,c) is the only vertex for which these equalities hold. It is also possible to define median graphs as the solution sets of 2-satisfiability problems, as the retracts of hypercubes, as the graphs of finite median algebras, as the Buneman graphs of Helly split systems, and as the graphs of windex 2; see the sections below.
Distributive lattices and median algebras
In lattice theory, the graph of a finite lattice has a vertex for each lattice element and an edge for each pair of elements in the covering relation of the lattice. Lattices are commonly presented visually via Hasse diagrams, which are drawings of graphs of lattices. These graphs, especially in the case of distributive lattices, turn out to be closely related to median graphs. In a distributive lattice, Birkhoff's self-dual ternary median operation m(a,b,c)=(a∧b)∨(a∧c)∨(b∧c)=(a∨b)∧(a∨c)∧(b∨c), satisfies certain key axioms, which it shares with the usual median of numbers in the range from 0 to 1 and with median algebras more generally:
Idempotence: m(a,a,b)=a for all a and b. Commutativity: m(a,b,c)=m(a,c,b)=m(b,a,c)=m(b,c,a)=m(c,a,b)=m(c,b,a) for all a, b, and c. Distributivity: m(a,m(b,c,d),e)=m(m(a,b,e),c,m(a,d,e)) for all a, b, c, d, and e. Identity elements: m(0,a,1)=a for all a. The distributive law may be replaced by an associative law:
… excerpt ends here. Continue reading the full article.





