Preply — Study more efficiently by working with a personal tutor. Get 50% off.Affiliate

Wikipedia

Median graph

Median graph

In graph theory, a division of mathematics, a median graph is an undirected graph in which every three vertices a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} have a unique median: a vertex m ( a , b , c ) {\displaystyle m(a,b,c)} that belongs to shortest paths between each pair of a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle 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 {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle 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 ) {\displaystyle m(a,b,c)} is equal to one of a {\displaystyle a} , b {\displaystyle b} , or c {\displaystyle 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 ) {\displaystyle m(a,b,c)} can be found as the median of the coordinates of a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle 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 ) {\displaystyle \kappa (G)} of an arbitrary undirected graph G {\displaystyle G} has a vertex for every clique (complete subgraph) of G {\displaystyle G} ; two vertices of κ ( G ) {\displaystyle \kappa (G)} are linked by an edge if the corresponding cliques differ by one vertex of G {\displaystyle 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 {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle 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 {\displaystyle a} and b {\displaystyle b} , the minimal number of edges between them is called their distance, denoted by d ( x , y ) {\displaystyle d(x,y)} . The interval of vertices that lie on shortest paths between a {\displaystyle a} and b {\displaystyle b} is defined as

I ( a , b ) = { v ∣ d ( a , b ) = d ( a , v ) + d ( v , b ) } . {\displaystyle I(a,b)=\{\,v\mid d(a,b)=d(a,v)+d(v,b)\,\}.}

A median graph is defined by the property that, for every three vertices a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} , these intervals intersect in a single point:

For all a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} ,

| I ( a , b ) ∩ I ( a , c ) ∩ I ( b , c ) | = 1. {\displaystyle |I(a,b)\cap I(a,c)\cap I(b,c)|=1.}

Equivalently, for every three vertices a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} one can find a vertex m ( a , b , c ) {\displaystyle 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 ) , {\displaystyle {\begin{aligned}d(a,b)&=d{\bigl (}a,m(a,b,c){\bigr )}+d{\bigl (}m(a,b,c),b{\bigr )},\\d(a,c)&=d{\bigl (}a,m(a,b,c){\bigr )}+d{\bigl (}m(a,b,c),c{\bigr )},\\d(b,c)&=d{\bigl (}b,m(a,b,c){\bigr )}+d{\bigl (}m(a,b,c),c{\bigr )},\end{aligned}}}

and m ( a , b , c ) {\displaystyle 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 {\displaystyle 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 ) , {\displaystyle m(a,b,c)=(a\land b)\lor (a\land c)\lor (b\land c)=(a\lor b)\land (a\lor c)\land (b\lor c),}

satisfies certain key axioms, which it shares with the usual median of numbers in the range from 0 {\displaystyle 0} to 1 {\displaystyle 1} and with median algebras more generally:

Idempotence: m ( a , a , b ) = a {\displaystyle m(a,a,b)=a} for all a {\displaystyle a} and b {\displaystyle 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 ) {\displaystyle 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 {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} . Distributivity: m ( a , m ( b , c , d ) , e ) = m ( m ( a , b , e ) , c , m ( a , d , e ) ) {\displaystyle m(a,m(b,c,d),e)=m(m(a,b,e),c,m(a,d,e))} for all a {\displaystyle a} , b {\displaystyle b} , c {\displaystyle c} , d {\displaystyle d} , and e {\displaystyle e} . Identity elements: m ( 0 , a , 1 ) = a {\displaystyle m(0,a,1)=a} for all a {\displaystyle a} . The distributive law may be replaced by an associative law:

Associativity: m ( x , w , m ( y , w , z ) ) = m ( m ( x , w , y ) , w , z ) {\displaystyle m(x,w,m(y,w,z))=m(m(x,w,y),w,z)}

The median operation may also be used to define a notion of intervals for distributive lattices:

I ( a , b ) = { x ∣ m ( a , x , b ) = x } = { x ∣ a ∧ b ≤ x ≤ a ∨ b } . {\displaystyle I(a,b)=\{x\mid m(a,x,b)=x\}=\{x\mid a\land b\leq x\leq a\lor b\}.}

The graph of a finite distributive lattice has an edge between vertices a {\displaystyle a} and b {\displaystyle b} whenever I ( a , b ) = a , b {\displaystyle I(a,b)={a,b}} . For every two vertices a {\displaystyle a} and b {\displaystyle b} of this graph, the interval I ( a , b ) {\displaystyle I(a,b)} defined in lattice-theoretic terms above consists of the vertices on shortest paths from a {\displaystyle a} to b {\displaystyle b} , and thus coincides with the graph-theoretic intervals defined earlier. For every three lattice elements a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} , m ( a , b , c ) {\displaystyle m(a,b,c)} is the unique intersection of the three intervals I ( a , b ) {\displaystyle I(a,b)} , I ( a , c ) {\displaystyle I(a,c)} , and I ( b , c ) {\displaystyle I(b,c)} . Therefore, the graph of an arbitrary finite distributive lattice is a median graph. Conversely, if a median graph G {\displaystyle G} contains two vertices 0 {\displaystyle 0} and 1 {\displaystyle 1} such that every other vertex lies on a shortest path between the two (equivalently, m ( 0 , a , 1 ) = a {\displaystyle m(0,a,1)=a} for all a {\displaystyle a} ), then we may define a distributive lattice in which a ∧ b = m ( a , 0 , b ) {\displaystyle a\land b=m(a,0,b)} and a ∨ b = m ( a , 1 , b ) {\displaystyle a\lor b=m(a,1,b)} , and G {\displaystyle G} will be the graph of this lattice. Duffus & Rival (1983) characterize graphs of distributive lattices directly as diameter-preserving retracts of hypercubes. More generally, every median graph gives rise to a ternary operation m {\displaystyle m} satisfying idempotence, commutativity, and distributivity, but possibly without the identity elements of a distributive lattice. Every ternary operation on a finite set that satisfies these three properties (but that does not necessarily have 0 {\displaystyle 0} and 1 {\displaystyle 1} elements) gives rise in the same way to a median graph.

Convex sets and Helly families In a median graph, a set S {\displaystyle S} of vertices is said to be convex if, for every two vertices a {\displaystyle a} and b {\displaystyle b} belonging to S {\displaystyle S} , the whole interval I ( a , b ) {\displaystyle I(a,b)} is a subset of S {\displaystyle S} . Equivalently, given the two definitions of intervals above, S {\displaystyle S} is convex if it contains every shortest path between two of its vertices, or if it contains the median of every set of three points at least two of which are from S {\displaystyle S} . Observe that the intersection of every pair of convex sets is itself convex. The convex sets in a median graph have the Helly property: if F {\displaystyle F} is an arbitrary family of pairwise-intersecting convex sets, then all sets in F {\displaystyle F} have a common intersection. For, if F {\displaystyle F} has only three convex sets S {\displaystyle S} , T {\displaystyle T} , and U {\displaystyle U} in it, with a {\displaystyle a} in the intersection of the pair S {\displaystyle S} and T {\displaystyle T} , b {\displaystyle b} in the intersection of the pair T {\displaystyle T} and U {\displaystyle U} , and c {\displaystyle c} in the intersection of the pair S {\displaystyle S} and U {\displaystyle U} , then every shortest path from a {\displaystyle a} to b {\displaystyle b} must lie within T {\displaystyle T} by convexity, and similarly every shortest path between the other two pairs of vertices must lie within the other two sets; but m ( a , b , c ) {\displaystyle m(a,b,c)} belongs to paths between all three pairs of vertices, so it lies within all three sets, and forms part of their common intersection. If F {\displaystyle F} has more than three convex sets in it, the result follows by induction on the number of sets, for one may replace an arbitrary pair of sets in F {\displaystyle F} by their intersection, using the result for triples of sets to show that the replaced family is still pairwise intersecting. A particularly important family of convex sets in a median graph, playing a role similar to that of halfspaces in Euclidean space, are the sets:

W u v = { w ∣ d ( w , u ) < d ( w , v ) } {\displaystyle W_{uv}=\{\,w\mid d(w,u)<d(w,v)\,\}}

defined for each edge u v {\displaystyle uv} of the graph. In words, W u v {\displaystyle W_{uv}} consists of the vertices closer to u {\displaystyle u} than to v {\displaystyle v} , or equivalently the vertices w {\displaystyle w} such that some shortest path from v {\displaystyle v} to w {\displaystyle w} goes through u {\displaystyle u} . To show that W u v {\displaystyle W_{uv}} is convex, let w 1 w 2 … w k {\displaystyle w_{1}w_{2}\dots w_{k}} be an arbitrary shortest path that starts and ends within W u v {\displaystyle W_{uv}} ; then w 2 {\displaystyle w_{2}} must also lie within W u v {\displaystyle W_{uv}} , for otherwise the two points m 1 = m ( u , w 1 , w k ) {\displaystyle m_{1}=m(u,w_{1},w_{k})} and m 2 = m ( m 1 , w 2 , … , w k ) {\displaystyle m_{2}=m(m_{1},w_{2},\dots ,w_{k})} could be shown (by considering the possible distances between the vertices) to be distinct medians of u {\displaystyle u} , w 1 {\displaystyle w_{1}} , and w k {\displaystyle w_{k}} , contradicting the definition of a median graph which requires medians to be unique. Thus, each successive vertex on a shortest path between two vertices of W u v {\displaystyle W_{uv}} also lies within W u v {\displaystyle W_{uv}} , so W u v {\displaystyle W_{uv}} contains all shortest paths between its nodes, one of the definitions of convexity. The Helly property for the sets W u v {\displaystyle W_{uv}} plays a key role in the characterization of median graphs as the solution of 2-satisfiability instances, below.

2-satisfiability Median graphs have a close connection to the solution sets of 2-satisfiability problems that can be used both to characterize these graphs and to relate them to adjacency-preserving maps of hypercubes. A 2-satisfiability instance consists of a collection of Boolean variables and a collection of clauses, constraints on certain pairs of variables requiring those two variables to avoid certain combinations of values. Usually such problems are expressed in conjunctive normal form, in which each clause is expressed as a disjunction and the whole set of constraints is expressed as a conjunction of clauses, such as

( x 11 ∨ x 12 ) ∧ ( x 21 ∨ x 22 ) ∧ ⋯ ∧ ( x n 1 ∨ x n 2 ) ∧ ⋯ . {\displaystyle (x_{11}\lor x_{12})\land (x_{21}\lor x_{22})\land \cdots \land (x_{n1}\lor x_{n2})\land \cdots .}

A solution to such an instance is an assignment of truth values to the variables that satisfies all the clauses, or equivalently that causes the conjunctive normal form expression for the instance to become true when the variable values are substituted into it. The family of all solutions has a natural structure as a median algebra, where the median of three solutions is formed by choosing each truth value to be the majority function of the values in the three solutions; it is straightforward to verify that this median solution cannot violate any of the clauses. Thus, these solutions form a median graph, in which the neighbor of each solution is formed by negating a set of variables that are all constrained to be equal or unequal to each other. Conversely, every median graph G {\displaystyle G} may be represented in this way as the solution set to a 2-satisfiability instance. To find such a representation, create a 2-satisfiability instance in which each variable describes the orientation of one of the edges in the graph (an assignment of a direction to the edge causing the graph to become directed rather than undirected) and each constraint allows two edges to share a pair of orientations only when there exists a vertex v {\displaystyle v} such that both orientations lie along shortest paths from other vertices to v {\displaystyle v} . Each vertex v {\displaystyle v} of G {\displaystyle G} corresponds to a solution to this 2-satisfiability instance in which all edges are directed towards v {\displaystyle v} . Each solution to the instance must come from some vertex v {\displaystyle v} in this way, where v {\displaystyle v} is the common intersection of the sets W u w {\displaystyle W_{uw}} for edges directed from w {\displaystyle w} to u {\displaystyle u} ; this common intersection exists due to the Helly property of the sets W u w {\displaystyle W_{uw}} . Therefore, the solutions to this 2-satisfiability instance correspond one-for-one with the vertices of G {\displaystyle G} .

Retracts of hypercubes

A retraction of a graph G {\displaystyle G} is an adjacency-preserving map from G {\displaystyle G} to one of its subgraphs. More precisely, it is a graph homomorphism φ {\displaystyle \varphi } from G {\displaystyle G} to itself such that φ ( v ) = v {\displaystyle \varphi (v)=v} for each vertex v {\displaystyle v} in the subgraph φ ( G ) {\displaystyle \varphi (G)} . The image of the retraction is called a retract of G {\displaystyle G} . Retractions are examples of metric maps: the distance between φ ( v ) {\displaystyle \varphi (v)} and φ ( w ) {\displaystyle \varphi (w)} , for every v {\displaystyle v} and w {\displaystyle w} , is at most equal to the distance between v {\displaystyle v} and w {\displaystyle w} , and is equal whenever v {\displaystyle v} and w {\displaystyle w} both belong to φ ( G ) {\displaystyle \varphi (G)} . Therefore, a retract must be an isometric subgraph of G {\displaystyle G} : distances in the retract equal those in G {\displaystyle G} . If G {\displaystyle G} is a median graph, and a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} are an arbitrary three vertices of a retract φ ( G ) {\displaystyle \varphi (G)} , then φ ( m ( a , b , c ) ) {\displaystyle \varphi (m(a,b,c))} must be a median of a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} , and so must equal m ( a , b , c ) {\displaystyle m(a,b,c)} . Therefore, φ ( G ) {\displaystyle \varphi (G)} contains medians of all triples of its vertices, and must also be a median graph. In other words, the family of median graphs is closed under the retraction operation. A hypercube graph, in which the vertices correspond to all possible k {\displaystyle k} -bit bitvectors and in which two vertices are adjacent when the corresponding bitvectors differ in only a single bit, is a special case of a k {\displaystyle k} -dimensional grid graph and is therefore a median graph. The median of three bitvectors a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} may be calculated by computing, in each bit position, the majority function of the bits of a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} . Since median graphs are closed under retraction, and include the hypercubes, every retract of a hypercube is a median graph. Conversely, every median graph must be the retract of a hypercube. This may be seen from the connection, described above, between median graphs and 2-satisfiability: let G {\displaystyle G} be the graph of solutions to a 2-satisfiability instance; without loss of generality this instance can be formulated in such a way that no two variables are always equal or always unequal in every solution. Then the space of all truth assignments to the variables of this instance forms a hypercube. For each clause, formed as the disjunction of two variables or their complements, in the 2-satisfiability instance, one can form a retraction of the hypercube in which truth assignments violating this clause are mapped to truth assignments in which both variables satisfy the clause, without changing the other variables in the truth assignment. The composition of the retractions formed in this way for each of the clauses gives a retraction of the hypercube onto the solution space of the instance, and therefore gives a representation of G {\displaystyle G} as the retract of a hypercube. In particular, median graphs are isometric subgraphs of hypercubes, and are therefore partial cubes. However, not all partial cubes are median graphs; for instance, a six-vertex cycle graph is a partial cube but is not a median graph. As Imrich & Klavžar (2000) describe, an isometric embedding of a median graph into a hypercube may be constructed in time O ( m log ⁡ n ) {\displaystyle O(m\log n)} , where n {\displaystyle n} and m {\displaystyle m} are the numbers of vertices and edges of the graph respectively.

Triangle-free graphs and recognition algorithms

The problems of testing whether a graph is a median graph, and whether a graph is triangle-free, both had been well studied when Imrich, Klavžar & Mulder (1999) observed that, in some sense, they are computationally equivalent. Therefore, the best known time bound for testing whether a graph is triangle-free, O ( m 1.41 ) {\displaystyle O(m^{1.41})} , applies as well to testing whether a graph is a median graph, and any improvement in median graph testing algorithms would also lead to an improvement in algorithms for detecting triangles in graphs. In one direction, suppose one is given as input a graph G {\displaystyle G} , and must test whether G {\displaystyle G} is triangle-free. From G {\displaystyle G} , construct a new graph H {\displaystyle H} having as vertices each set of zero, one, or two adjacent vertices of G {\displaystyle G} . Two such sets are adjacent in H {\displaystyle H} when they differ by exactly one vertex. An equivalent description of H {\displaystyle H} is that it is formed by splitting each edge of G {\displaystyle G} into a path of two edges, and adding a new vertex connected to all the original vertices of G {\displaystyle G} . This graph H {\displaystyle H} is by construction a partial cube, but it is a median graph only when G {\displaystyle G} is triangle-free: if a {\displaystyle a} , b {\displaystyle b} , and c {\displaystyle c} form a triangle in G {\displaystyle G} , then { a , b } {\displaystyle \{a,b\}} , { a , c

Tags

  • Bipartite graphs
  • Graph families
  • Lattice theory
  • Phylogenetics
  • Social choice theory