Median Graph
   HOME

TheInfoList



OR:

In
graph theory In mathematics, graph theory is the study of ''graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of '' vertices'' (also called ''nodes'' or ''points'') which are conne ...
, a division of
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, a median graph is an
undirected graph In discrete mathematics, and more specifically in graph theory, a graph is a structure amounting to a set of objects in which some pairs of the objects are in some sense "related". The objects correspond to mathematical abstractions called '' v ...
in which every three vertices ''a'', ''b'', and ''c'' have a unique ''median'': a vertex ''m''(''a'',''b'',''c'') that belongs to
shortest path In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. The problem of finding the shortest path between tw ...
s between each pair of ''a'', ''b'', and ''c''. The concept of median graphs has long been studied, for instance by or (more explicitly) by , but the first paper to call them "median graphs" appears to be . As Chung,
Graham Graham and Graeme may refer to: People * Graham (given name), an English-language given name * Graham (surname), an English-language surname * Graeme (surname), an English-language surname * Graham (musician) (born 1979), Burmese singer * Clan ...
, and Saks write, "median graphs arise naturally in the study of ordered sets and discrete
distributive lattice In mathematics, a distributive lattice is a lattice in which the operations of join and meet distribute over each other. The prototypical examples of such structures are collections of sets for which the lattice operations can be given by set uni ...
s, and have an extensive literature".. In
phylogenetics In biology, phylogenetics (; from Greek language, Greek wikt:φυλή, φυλή/wikt:φῦλον, φῦλον [] "tribe, clan, race", and wikt:γενετικός, γενετικός [] "origin, source, birth") is the study of the evolutionary his ...
, the Buneman graph representing all
maximum parsimony In phylogenetics, maximum parsimony is an optimality criterion under which the phylogenetic tree that minimizes the total number of character-state changes (or miminizes the cost of differentially weighted character-state changes) is preferred. ...
Phylogenetic tree, evolutionary trees is a median graph. Median graphs also arise in
social choice theory Social choice theory or social choice is a theoretical framework for analysis of combining individual opinions, preferences, interests, or welfares to reach a ''collective decision'' or ''social welfare'' in some sense.Amartya Sen (2008). "Soci ...
: 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 , , and .


Examples

Every
tree In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, including only woody plants with secondary growth, plants that are ...
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 Degree may refer to: As a unit of measurement * Degree (angle), a unit of angle measurement ** Degree of geographical latitude ** Degree of geographical longitude * Degree symbol (°), a notation used in science, engineering, and mathematics ...
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 graph In graph theory, a lattice graph, mesh graph, or grid graph is a graph whose drawing, embedded in some Euclidean space , forms a regular tiling. This implies that the group of bijective transformations that send the graph to itself is a latti ...
s. 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 mathematics, the -dimensional integer lattice (or cubic lattice), denoted , is the lattice in the Euclidean space whose lattice points are -tuples of integers. The two-dimensional integer lattice is also called the square lattice, or grid ...
in such a way that medians can be calculated coordinatewise in this way.
Squaregraph In graph theory, a branch of mathematics, a squaregraph is a type of undirected graph that can be drawn in the plane in such a way that every bounded face is a quadrilateral and every vertex with three or fewer neighbors is incident to an unbound ...
s, 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 A polyomino is a plane geometric figure formed by joining one or more equal squares edge to edge. It is a polyform whose cells are squares. It may be regarded as a finite subset of the regular square tiling. Polyominoes have been used in pop ...
is a special case of a squaregraph and therefore also forms a median graph. The
simplex graph In graph theory, a branch of mathematics, the simplex graph of an undirected graph is itself a graph, with one node for each clique (a set of mutually adjacent vertices) in . Two nodes of are linked by an edge whenever the corresponding two c ...
κ(''G'') of an arbitrary undirected graph ''G'' has a vertex for every
clique A clique ( AusE, CanE, or ), in the social sciences, is a group of individuals who interact with one another and share similar interests. Interacting with cliques is part of normative social development regardless of gender, ethnicity, or popular ...
(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 Majority rule is a principle that means the decision-making power belongs to the group that has the most members. In politics, majority rule requires the deciding vote to have majority, that is, more than half the votes. It is the binary deci ...
to determine which vertices of the cliques to include. No
cycle graph In graph theory, a cycle graph or circular graph is a graph that consists of a single cycle, or in other words, some number of vertices (at least 3, if the graph is simple) connected in a closed chain. The cycle graph with vertices is called ...
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 Distance is a numerical or occasionally qualitative measurement of how far apart objects or points are. In physics or everyday usage, distance may refer to a physical length or an estimation based on other criteria (e.g. "two counties over"). ...
'', denoted by ''d''(''x'',''y''). The ''interval'' of vertices that lie on shortest paths between ''a'' and ''b'' is defined as :''I''(''a'',''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 this is true. It is also possible to define median graphs as the solution sets of 2-satisfiability problems, as the retracts of
hypercubes In geometry, a hypercube is an ''n''-dimensional analogue of a square () and a cube (). It is a closed, compact, convex figure whose 1-skeleton consists of groups of opposite parallel line segments aligned in each of the space's dimensions, perp ...
, as the graphs of finite
median algebra In mathematics, a median algebra is a set with a ternary operation \langle x,y,z \rangle satisfying a set of axioms which generalise the notions of medians of triples of real numbers and of the Boolean majority function. The axioms are # \lang ...
s, 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 A lattice is an abstract structure studied in the mathematical subdisciplines of order theory and abstract algebra. It consists of a partially ordered set in which every pair of elements has a unique supremum (also called a least upper bou ...
, the graph of a
finite Finite is the opposite of infinite. It may refer to: * Finite number (disambiguation) * Finite set, a set whose cardinality (number of elements) is some natural number * Finite verb, a verb form that has a subject, usually being inflected or marke ...
lattice Lattice may refer to: Arts and design * Latticework, an ornamental criss-crossed framework, an arrangement of crossing laths or other thin strips of material * Lattice (music), an organized grid model of pitch ratios * Lattice (pastry), an orna ...
has a vertex for each lattice element and an edge for each pair of elements in the
covering relation In mathematics, especially order theory, the covering relation of a partially ordered set is the binary relation which holds between comparable elements that are immediate neighbours. The covering relation is commonly used to graphically expres ...
of the lattice. Lattices are commonly presented visually via
Hasse diagram In order theory, a Hasse diagram (; ) is a type of mathematical diagram used to represent a finite partially ordered set, in the form of a drawing of its transitive reduction. Concretely, for a partially ordered set ''(S, ≤)'' one represents ea ...
s, which are
drawing Drawing is a form of visual art in which an artist uses instruments to mark paper or other two-dimensional surface. Drawing instruments include graphite pencils, pen and ink, various kinds of paints, inked brushes, colored pencils, crayons, ...
s of graphs of lattices. These graphs, especially in the case of
distributive lattice In mathematics, a distributive lattice is a lattice in which the operations of join and meet distribute over each other. The prototypical examples of such structures are collections of sets for which the lattice operations can be given by set uni ...
s, turn out to be closely related to median graphs. In a distributive lattice, Birkhoff's self-dual
ternary Ternary (from Latin ''ternarius'') or trinary is an adjective meaning "composed of three items". It can refer to: Mathematics and logic * Ternary numeral system, a base-3 counting system ** Balanced ternary, a positional numeral system, useful ...
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 In statistics and probability theory, the median is the value separating the higher half from the lower half of a data sample, a population, or a probability distribution. For a data set, it may be thought of as "the middle" value. The basic fe ...
of numbers in the range from 0 to 1 and with
median algebra In mathematics, a median algebra is a set with a ternary operation \langle x,y,z \rangle satisfying a set of axioms which generalise the notions of medians of triples of real numbers and of the Boolean majority function. The axioms are # \lang ...
s more generally: *
Idempotence Idempotence (, ) is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of pl ...
: for all ''a'' and ''b''. *
Commutativity In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Most familiar as the name of ...
: = 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 In mathematics, the distributive property of binary operations generalizes the distributive law, which asserts that the equality x \cdot (y + z) = x \cdot y + x \cdot z is always true in elementary algebra. For example, in elementary arithmeti ...
: for all ''a'', ''b'', ''c'', ''d'', and ''e''. *
Identity element In mathematics, an identity element, or neutral element, of a binary operation operating on a set is an element of the set that leaves unchanged every element of the set when the operation is applied. This concept is used in algebraic structures su ...
s: ''m''(0,''a'',1) = ''a'' for all ''a''. The distributive law may be replaced by an associative law: *
Associativity In mathematics, the associative property is a property of some binary operations, which means that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement f ...
: ''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'') = = . The graph of a finite distributive lattice has an edge between vertices ''a'' and ''b'' whenever ''I''(''a'',''b'') = . For every two vertices ''a'' and ''b'' of this graph, the interval defined in lattice-theoretic terms above consists of the vertices on shortest paths from ''a'' to ''b'', and thus coincides with the graph-theoretic intervals defined earlier. For every three lattice elements ''a'', ''b'', and ''c'', ''m''(''a'',''b'',''c'') is the unique intersection of the three intervals , and . Therefore, the graph of an arbitrary finite distributive lattice is a median graph. Conversely, if a median graph ''G'' contains two vertices 0 and 1 such that every other vertex lies on a shortest path between the two (equivalently, ''m''(0,''a'',1) = ''a'' for all ''a''), then we may define a distributive lattice in which ''a'' ∧ ''b'' = ''m''(''a'',0,''b'') and ''a'' ∨ ''b'' = ''m''(''a'',1,''b''), and ''G'' will be the graph of this lattice. characterize graphs of distributive lattices directly as diameter-preserving retracts of hypercubes. More generally, every median graph gives rise to a ternary operation ''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 and 1 elements) gives rise in the same way to a median graph.


Convex sets and Helly families

In a median graph, a set ''S'' of vertices is said to be
convex Convex or convexity may refer to: Science and technology * Convex lens, in optics Mathematics * Convex set, containing the whole line segment that joins points ** Convex polygon, a polygon which encloses a convex set of points ** Convex polytope ...
if, for every two vertices ''a'' and ''b'' belonging to ''S'', the whole interval ''I''(''a'',''b'') is a subset of ''S''. Equivalently, given the two definitions of intervals above, ''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''. Observe that the intersection of every pair of convex sets is itself convex. The convex sets in a median graph have the
Helly property In combinatorics, a Helly family of order is a family of sets in which every minimal ''subfamily with an empty intersection'' has or fewer sets in it. Equivalently, every finite subfamily such that every -fold intersection is non-empty has non ...
: if ''F'' is an arbitrary family of pairwise-intersecting convex sets, then all sets in ''F'' have a common intersection. For, if ''F'' has only three convex sets ''S'', ''T'', and ''U'' in it, with ''a'' in the intersection of the pair ''S'' and ''T'', ''b'' in the intersection of the pair ''T'' and ''U'', and ''c'' in the intersection of the pair ''S'' and ''U'', then every shortest path from ''a'' to ''b'' must lie within ''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'') 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'' 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'' 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
halfspace Half-space may refer to: * Half-space (geometry), either of the two parts into which a plane divides Euclidean space * Half-space (punctuation), a spacing character half the width of a regular space * (Poincaré) Half-space model, a model of 3-di ...
s in Euclidean space, are the sets :''Wuv'' = defined for each edge ''uv'' of the graph. In words, ''Wuv'' consists of the vertices closer to ''u'' than to ''v'', or equivalently the vertices ''w'' such that some shortest path from ''v'' to ''w'' goes through ''u''. To show that ''Wuv'' is convex, let ''w''1''w''2...''w''''k'' be an arbitrary shortest path that starts and ends within ''Wuv''; then ''w''2 must also lie within ''Wuv'', for otherwise the two points ''m''1 = ''m''(''u'',''w''1,''w''''k'') and ''m''2 = ''m''(''m''1,''w''2...''w''''k'') could be shown (by considering the possible distances between the vertices) to be distinct medians of ''u'', ''w''1, and ''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 ''Wuv'' also lies within ''Wuv'', so ''Wuv'' contains all shortest paths between its nodes, one of the definitions of convexity. The Helly property for the sets ''Wuv'' 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 variable In computer science, the Boolean (sometimes shortened to Bool) is a data type that has one of two possible values (usually denoted ''true'' and ''false'') which is intended to represent the two truth values of logic and Boolean algebra. It is name ...
s 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 Boolean logic, a formula is in conjunctive normal form (CNF) or clausal normal form if it is a conjunction of one or more clauses, where a clause is a disjunction of literals; otherwise put, it is a product of sums or an AND of ORs. As a can ...
, in which each clause is expressed as a
disjunction In logic, disjunction is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language sentence "it is raining or it is snowing" can be represented in logic using the disjunctive formula R \lor S ...
and the whole set of constraints is expressed as a
conjunction Conjunction may refer to: * Conjunction (grammar), a part of speech * Logical conjunction, a mathematical operator ** Conjunction introduction, a rule of inference of propositional logic * Conjunction (astronomy), in which two astronomical bodies ...
of clauses, such as :(x_ \lor x_) \land (x_ \lor x_) \land \cdots \land (x_ \lor x_) \land \cdots. A solution to such an instance is an assignment of
truth value In logic and mathematics, a truth value, sometimes called a logical value, is a value indicating the relation of a proposition to truth, which in classical logic has only two possible values (''true'' or '' false''). Computing In some progr ...
s 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 In Boolean logic, the majority function (also called the median operator) is the Boolean function that evaluates to false when half or more arguments are false and true otherwise, i.e. the value of the function equals the value of the majority of t ...
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'' 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 Director may refer to: Literature * ''Director'' (magazine), a British magazine * ''The Director'' (novel), a 1971 novel by Henry Denker * ''The Director'' (play), a 2000 play by Nancy Hasty Music * Director (band), an Irish rock band * ''D ...
rather than undirected) and each constraint allows two edges to share a pair of orientations only when there exists a vertex ''v'' such that both orientations lie along shortest paths from other vertices to ''v''. Each vertex ''v'' of ''G'' corresponds to a solution to this 2-satisfiability instance in which all edges are directed towards ''v''. Each solution to the instance must come from some vertex ''v'' in this way, where ''v'' is the common intersection of the sets ''Wuw'' for edges directed from ''w'' to ''u''; this common intersection exists due to the Helly property of the sets ''Wuw''. Therefore, the solutions to this 2-satisfiability instance correspond one-for-one with the vertices of ''G''.


Retracts of hypercubes

A ''retraction'' of a graph ''G'' is an adjacency-preserving map from ''G'' to one of its subgraphs. More precisely, it is
graph homomorphism In the mathematical field of graph theory, a graph homomorphism is a mapping between two graphs that respects their structure. More concretely, it is a function between the vertex sets of two graphs that maps adjacent vertices to adjacent verti ...
φ from ''G'' to itself such that φ(''v'') = ''v'' for each vertex ''v'' in the subgraph φ(G). The image of the retraction is called a ''retract'' of ''G''. Retractions are examples of
metric map In the mathematical theory of metric spaces, a metric map is a function between metric spaces that does not increase any distance (such functions are always continuous). These maps are the morphisms in the category of metric spaces, Met (Isbell 1 ...
s: the distance between φ(''v'') and φ(''w''), for every ''v'' and ''w'', is at most equal to the distance between ''v'' and ''w'', and is equal whenever ''v'' and ''w'' both belong to φ(''G''). Therefore, a retract must be an ''isometric subgraph'' of ''G'': distances in the retract equal those in ''G''. If ''G'' is a median graph, and ''a'', ''b'', and ''c'' are an arbitrary three vertices of a retract φ(''G''), then φ(''m''(''a'',''b'',''c'')) must be a median of ''a'', ''b'', and ''c'', and so must equal ''m''(''a'',''b'',''c''). Therefore, φ(''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 graph theory, the hypercube graph is the graph formed from the vertices and edges of an -dimensional hypercube. For instance, the cube graph is the graph formed by the 8 vertices and 12 edges of a three-dimensional cube. has vertices, e ...
, in which the vertices correspond to all possible ''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''-dimensional grid graph and is therefore a median graph. The median of three bitvectors ''a'', ''b'', and ''c'' may be calculated by computing, in each bit position, the
majority function In Boolean logic, the majority function (also called the median operator) is the Boolean function that evaluates to false when half or more arguments are false and true otherwise, i.e. the value of the function equals the value of the majority of t ...
of the bits of ''a'', ''b'', and ''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'' 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'' as the retract of a hypercube. In particular, median graphs are isometric subgraphs of hypercubes, and are therefore
partial cube In graph theory, a partial cube is a graph that is isometric to a subgraph of a hypercube. In other words, a partial cube can be identified with a subgraph of a hypercube in such a way that the distance between any two vertices in the partial c ...
s. However, not all partial cubes are median graphs; for instance, a six-vertex
cycle graph In graph theory, a cycle graph or circular graph is a graph that consists of a single cycle, or in other words, some number of vertices (at least 3, if the graph is simple) connected in a closed chain. The cycle graph with vertices is called ...
is a partial cube but is not a median graph. As describe, an isometric embedding of a median graph into a hypercube may be constructed in time O(''m'' log ''n''), where ''n'' and ''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 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), 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'', and must test whether ''G'' is triangle-free. From ''G'', construct a new graph ''H'' having as vertices each set of zero, one, or two adjacent vertices of ''G''. Two such sets are adjacent in ''H'' when they differ by exactly one vertex. An equivalent description of ''H'' is that it is formed by splitting each edge of ''G'' into a path of two edges, and adding a new vertex connected to all the original vertices of ''G''. This graph ''H'' is by construction a partial cube, but it is a median graph only when ''G'' is triangle-free: if ''a'', ''b'', and ''c'' form a triangle in ''G'', then , , and have no median in ''H'', for such a median would have to correspond to the set , but sets of three or more vertices of ''G'' do not form vertices in ''H''. Therefore, ''G'' is triangle-free if and only if ''H'' is a median graph. In the case that ''G'' is triangle-free, ''H'' is its
simplex graph In graph theory, a branch of mathematics, the simplex graph of an undirected graph is itself a graph, with one node for each clique (a set of mutually adjacent vertices) in . Two nodes of are linked by an edge whenever the corresponding two c ...
. An algorithm to test efficiently whether ''H'' is a median graph could by this construction also be used to test whether ''G'' is triangle-free. This transformation preserves the computational complexity of the problem, for the size of ''H'' is proportional to that of ''G''. The reduction in the other direction, from triangle detection to median graph testing, is more involved and depends on the previous median graph recognition algorithm of , which tests several necessary conditions for median graphs in near-linear time. The key new step involves using a
breadth first search Breadth-first search (BFS) is an algorithm for searching a tree data structure for a node that satisfies a given property. It starts at the tree root and explores all nodes at the present depth prior to moving on to the nodes at the next d ...
to partition the graph's vertices into levels according to their distances from some arbitrarily chosen root vertex, forming a graph from each level in which two vertices are adjacent if they share a common neighbor in the previous level, and searching for triangles in these graphs. The median of any such triangle must be a common neighbor of the three triangle vertices; if this common neighbor does not exist, the graph is not a median graph. If all triangles found in this way have medians, and the previous algorithm finds that the graph satisfies all the other conditions for being a median graph, then it must actually be a median graph. This algorithm requires, not just the ability to test whether a triangle exists, but a list of all triangles in the level graph. In arbitrary graphs, listing all triangles sometimes requires Ω(''m''3/2) time, as some graphs have that many triangles, however Hagauer et al. show that the number of triangles arising in the level graphs of their reduction is near-linear, allowing the Alon et al. fast matrix multiplication based technique for finding triangles to be used.


Evolutionary trees, Buneman graphs, and Helly split systems

Phylogeny A phylogenetic tree (also phylogeny or evolutionary tree Felsenstein J. (2004). ''Inferring Phylogenies'' Sinauer Associates: Sunderland, MA.) is a branching diagram or a tree showing the evolutionary relationships among various biological spec ...
is the inference of
evolutionary tree A phylogenetic tree (also phylogeny or evolutionary tree Felsenstein J. (2004). ''Inferring Phylogenies'' Sinauer Associates: Sunderland, MA.) is a branching diagram or a tree showing the evolutionary relationships among various biological spec ...
s from observed characteristics of
species In biology, a species is the basic unit of classification and a taxonomic rank of an organism, as well as a unit of biodiversity. A species is often defined as the largest group of organisms in which any two individuals of the appropriate s ...
; such a tree must place the species at distinct vertices, and may have additional ''latent vertices'', but the latent vertices are required to have three or more incident edges and must also be labeled with characteristics. A characteristic is ''binary'' when it has only two possible values, and a set of species and their characteristics exhibit
perfect phylogeny Perfect phylogeny is a term used in computational phylogenetics to denote a phylogenetic tree in which all internal nodes may be labeled such that all characters evolve down the tree without homoplasy. That is, characteristics do not hold to conver ...
when there exists an evolutionary tree in which the vertices (species and latent vertices) labeled with any particular characteristic value form a contiguous subtree. If a tree with perfect phylogeny is not possible, it is often desired to find one exhibiting
maximum parsimony In phylogenetics, maximum parsimony is an optimality criterion under which the phylogenetic tree that minimizes the total number of character-state changes (or miminizes the cost of differentially weighted character-state changes) is preferred. ...
, or equivalently, minimizing the number of times the endpoints of a tree edge have different values for one of the characteristics, summed over all edges and all characteristics. described a method for inferring perfect phylogenies for binary characteristics, when they exist. His method generalizes naturally to the construction of a median graph for any set of species and binary characteristics, which has been called the ''median network'' or ''Buneman graph'' and is a type of
phylogenetic network A phylogenetic network is any graph used to visualize evolutionary relationships (either abstractly or explicitly) between nucleotide sequences, genes, chromosomes, genomes, or species. They are employed when reticulation events such as hybridi ...
. Every maximum parsimony evolutionary tree embeds into the Buneman graph, in the sense that tree edges follow paths in the graph and the number of characteristic value changes on the tree edge is the same as the number in the corresponding path. The Buneman graph will be a tree if and only if a perfect phylogeny exists; this happens when there are no two incompatible characteristics for which all four combinations of characteristic values are observed. To form the Buneman graph for a set of species and characteristics, first, eliminate redundant species that are indistinguishable from some other species and redundant characteristics that are always the same as some other characteristic. Then, form a latent vertex for every combination of characteristic values such that every two of the values exist in some known species. In the example shown, there are small brown tailless mice, small silver tailless mice, small brown tailed mice, large brown tailed mice, and large silver tailed mice; the Buneman graph method would form a latent vertex corresponding to an unknown species of small silver tailed mice, because every pairwise combination (small and silver, small and tailed, and silver and tailed) is observed in some other known species. However, the method would not infer the existence of large brown tailless mice, because no mice are known to have both the large and tailless traits. Once the latent vertices are determined, form an edge between every pair of species or latent vertices that differ in a single characteristic. One can equivalently describe a collection of binary characteristics as a ''split system'', a
family of sets In set theory and related branches of mathematics, a collection F of subsets of a given set S is called a family of subsets of S, or a family of sets over S. More generally, a collection of any sets whatsoever is called a family of sets, set fam ...
having the property that the
complement set In set theory, the complement of a set , often denoted by (or ), is the set of elements not in . When all sets in the universe, i.e. all sets under consideration, are considered to be members of a given set , the absolute complement of is t ...
of each set in the family is also in the family. This split system has a set for each characteristic value, consisting of the species that have that value. When the latent vertices are included, the resulting split system has the
Helly property In combinatorics, a Helly family of order is a family of sets in which every minimal ''subfamily with an empty intersection'' has or fewer sets in it. Equivalently, every finite subfamily such that every -fold intersection is non-empty has non ...
: every pairwise intersecting subfamily has a common intersection. In some sense median graphs are characterized as coming from Helly split systems: the pairs (''Wuv'', ''Wvu'') defined for each edge ''uv'' of a median graph form a Helly split system, so if one applies the Buneman graph construction to this system no latent vertices will be needed and the result will be the same as the starting graph. and describe techniques for simplified hand calculation of the Buneman graph, and use this construction to visualize human genetic relationships.


Additional properties

*The
Cartesian product In mathematics, specifically set theory, the Cartesian product of two sets ''A'' and ''B'', denoted ''A''×''B'', is the set of all ordered pairs where ''a'' is in ''A'' and ''b'' is in ''B''. In terms of set-builder notation, that is : A\ti ...
of every two median graphs is another median graph. Medians in the product graph may be computed by independently finding the medians in the two factors, just as medians in grid graphs may be computed by independently finding the median in each linear dimension. *The ''windex'' of a graph measures the amount of lookahead needed to optimally solve a problem in which one is given a sequence of graph vertices ''si'', and must find as output another sequence of vertices ''ti'' minimizing the sum of the distances and . Median graphs are exactly the graphs that have ''windex'' 2. In a median graph, the optimal choice is to set . *The property of having a unique median is also called the ''unique Steiner point property''. An optimal
Steiner tree In combinatorial mathematics, the Steiner tree problem, or minimum Steiner tree problem, named after Jakob Steiner, is an umbrella term for a class of problems in combinatorial optimization. While Steiner tree problems may be formulated in a n ...
for three vertices ''a'', ''b'', and ''c'' in a median graph may be found as the union of three shortest paths, from ''a'', ''b'', and ''c'' to ''m''(''a'',''b'',''c''). study more generally the problem of finding the vertex minimizing the sum of distances to each of a given set of vertices, and show that it has a unique solution for any odd number of vertices in a median graph. They also show that this median of a set ''S'' of vertices in a median graph satisfies the
Condorcet criterion An electoral system satisfies the Condorcet winner criterion () if it always chooses the Condorcet winner when one exists. The candidate who wins a majority of the vote in every head-to-head election against each of the other candidatesthat is, a ...
for the winner of an
election An election is a formal group decision-making process by which a population chooses an individual or multiple individuals to hold public office. Elections have been the usual mechanism by which modern representative democracy has opera ...
: compared to any other vertex, it is closer to a majority of the vertices in ''S''. *As with partial cubes more generally, every median graph with ''n'' vertices has at most (''n''/2) log2 ''n'' edges. However, the number of edges cannot be too small: prove that in every median graph the inequality holds, where ''m'' is the number of edges and ''k'' is the dimension of the hypercube that the graph is a retract of. This inequality is an equality if and only if the median graph contains no cubes. This is a consequence of another identity for median graphs: the
Euler characteristic In mathematics, and more specifically in algebraic topology and polyhedral combinatorics, the Euler characteristic (or Euler number, or Euler–Poincaré characteristic) is a topological invariant, a number that describes a topological space ...
Σ (-1)dim(''Q'') is always equal to one, where the sum is taken over all hypercube subgraphs ''Q'' of the given median graph. *The only regular median graphs are the hypercubes. *Every median graph is a
modular graph In graph theory, a branch of mathematics, the modular graphs are undirected graphs in which every three vertices , , and have at least one ''median vertex'' that belongs to shortest paths between each pair of , , and .Modular graphs
Information System on Graph Classes and their Inclusions, retrieved 2016-09-30.


Notes


References

*. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. {{refend


External links



Information System for Graph Class Inclusions.

Free Phylogenetic Network Software. Network generates evolutionary trees and networks from genetic, linguistic, and other data.
PhyloMurka
open-source software for median network computations from biological data. Graph families Bipartite graphs Lattice theory Social choice theory Phylogenetics