Median algebra

In mathematics, a median algebra is a set with a ternary operation

satisfying a set of axioms which generalise the notions of medians of triples of real numbers and of the Boolean majority function.

The fourth axiom implies associativity.

There are other possible axiom systems: for example the two also suffice.

In a Boolean algebra, or more generally a distributive lattice, the median function

satisfies these axioms, so that every Boolean algebra and every distributive lattice forms a median algebra.

Birkhoff and Kiss showed that a median algebra with elements 0 and 1 satisfying

defines a median algebra having the vertices of the graph as its elements.

Conversely, in any median algebra, one may define an interval

One may define a graph from a median algebra by creating a vertex for each algebra element and an edge for each pair

If the algebra has the property that every interval is finite, then this graph is a median graph, and it accurately represents the algebra in that the median operation defined by shortest paths on the graph coincides with the algebra's original median operation.