This article or sectionis undergoing significant expansion or restructuring. You are welcome to assist in its construction by editing it as well. If this article or sectionhas not been edited in several days, please remove this template. If you are actively editing this article or section, you can replace this template with{{in use|5 minutes}}.This article waslast edited byAnomieBOT(talk |contribs) 2 hours ago.(Updatetimer)
A graph with 6 vertices and 7 edges
Inmathematics andcomputer science,graph theory is the study ofgraphs, which aremathematical structures used to model pairwise relations between objects. A graph in this context is made up ofvertices (also callednodes orpoints) which are connected byedges (also calledarcs,links orlines). A distinction is made betweenundirected graphs, where edges link two vertices symmetrically, anddirected graphs, where edges link two vertices asymmetrically. Graphs are one of the principal objects of study indiscrete mathematics.
A graph consists of vertices connected by edges. A graph is occasionally called:
An undirected graph (top left), distinguishing it from adirected graph that has an arrow on each edge (top right). Undirected and directed graphs can be merged into amixed graph (bottom left); and
A simple graph, distinguishing it from amultigraph (bottom right).
Graph theory is a branch of mathematics that studiesgraphs, a mathematical structure for modelling pairwise relations between objects. The definition of a graph can vary, but one can understand that a graph is a structure that contains the vertices (also called nodes or points) and edges (also called arcs, links, or lines). Two vertices of an edge are called the endpoints.[1]
Occasionally, a graph is called an undirected graph, to distinguish it from adirected graph. A directed graph is a graph where each edge has an assignment direction known asorientation, designated with an arrow.[2] Amixed graph can have edges that may be directed, and some may be undirected.[3] A graph can also be called a simple graph, to distinguish it from amultigraph. A multiple graph allows many edges to have the same pair of endpoints.
The paper written byLeonhard Euler on theSeven Bridges of Königsberg and published in 1736 is regarded as the first paper in the history of graph theory.[4] This paper, as well as the one written byVandermonde on theknight problem, carried on with theanalysis situs initiated byLeibniz. Euler's formula relating the number of edges, vertices, and faces of a convex polyhedron was studied and generalized byCauchy[5] andL'Huilier,[6] and represents the beginning of the branch of mathematics known astopology.
More than one century after Euler's paper on the bridges ofKönigsberg and whileListing was introducing the concept of topology,Cayley was led by an interest in particular analytical forms arising fromdifferential calculus to study a particular class of graphs, thetrees.[7] This study had many implications for theoreticalchemistry. The techniques he used mainly concern theenumeration of graphs with particular properties. Enumerative graph theory then arose from the results of Cayley and the fundamental results published byPólya between 1935 and 1937. These were generalized byDe Bruijn in 1959. Cayley linked his results on trees with contemporary studies of chemical composition.[8] The fusion of ideas from mathematics with those from chemistry began what has become part of the standard terminology of graph theory.
In particular, the term "graph" was introduced bySylvester in a paper published in 1878 inNature, where he draws an analogy between "quantic invariants" and "co-variants" of algebra and molecular diagrams:[9]
"[…] Every invariant and co-variant thus becomes expressible by agraph precisely identical with aKekuléan diagram or chemicograph. […] I give a rule for the geometrical multiplication of graphs,i.e. for constructing agraph to the product of in- or co-variants whose separate graphs are given. […]" (italics as in the original).
The first textbook on graph theory was written byDénes Kőnig, and published in 1936.[10] Another book byFrank Harary, published in 1969, was "considered the world over to be the definitive textbook on the subject",[11] and enabled mathematicians, chemists, electrical engineers and social scientists to talk to each other. Harary donated all of the royalties to fund thePólya Prize.[12]
One of the most famous and stimulating problems in graph theory is thefour color problem: "Is it true that any map drawn in the plane may have its regions colored with four colors, in such a way that any two regions having a common border have different colors?" This problem was first posed byFrancis Guthrie in 1852 and its first written record is in a letter ofDe Morgan addressed toHamilton the same year. Many incorrect proofs have been proposed, including those by Cayley,Kempe, and others. The study and the generalization of this problem byTait,Heawood,Ramsey andHadwiger led to the study of the colorings of the graphs embedded on surfaces with arbitrarygenus. Tait's reformulation generated a new class of problems, thefactorization problems, particularly studied byPetersen andKőnig. The works of Ramsey on colorations and more specially the results obtained byTurán in 1941 was at the origin of another branch of graph theory,extremal graph theory.
The four color problem remained unsolved for more than a century. In 1969Heinrich Heesch published a method for solving the problem using computers.[13] A computer-aided proof produced in 1976 byKenneth Appel andWolfgang Haken makes fundamental use of the notion of "discharging" developed by Heesch.[14][15] The proof involved checking the properties of 1,936 configurations by computer, and was not fully accepted at the time due to its complexity. A simpler proof considering only 633 configurations was given twenty years later byRobertson,Seymour,Sanders andThomas.[16]
The autonomous development of topology from 1860 and 1930 fertilized graph theory back through the works ofJordan,Kuratowski andWhitney. Another important factor of common development of graph theory andtopology came from the use of the techniques of modern algebra. The first example of such a use comes from the work of the physicistGustav Kirchhoff, who published in 1845 hisKirchhoff's circuit laws for calculating thevoltage andcurrent inelectric circuits.
The introduction of probabilistic methods in graph theory, especially in the study ofErdős andRényi of the asymptotic probability of graph connectivity, gave rise to yet another branch, known asrandom graph theory, which has been a fruitful source of graph-theoretic results.
The embedding of a graph in a surface is the representation of a graph in which the points are associated with the vertices and simple arcs with edges in a surface. The endpoints are associated with an edge, and the points with the end vertices. No arcs include points associated with other vertices, and two arcs never intersect at a point that is interior to either of the arcs.[citation needed] The linkless embedding of an undirected graph is a graph embedding into three-dimensional Euclidean space such that no two cycles of the graph are linked.[19]
Algebraic graph theory also studies the algebraicinvariants,chromatic polynomial,Tutte polynomial of a graph, andknot invariant.[25] A graph invariant is a property of graphs that depends only on the abstract structure, instead of labellings or drawings of the graph. A chromatic polynomial is s a polynomial that counts the number ofgraph colorings as a function of the number of colors.[26] The Tutte polynomial is a two-variable polynomial on graph connectivity.[27]
Geometric graph theory studies a graph drawn with straight-line or continuous curved edges with geometric properties combinatorially. Within these illustrations, the geometric graph theory studies:
A planar graph wherein its vertices are embedded as points, and its edges are non-crossingline segments in theEuclidean plane is calledplanar straight-line graph. Any planar graph can be represented as a planar straight-line graph byFáry's theorem. The planar straight-line graph is the special case of a Euclidean graph. The Euclidean graph allows its edges to have the length of theEuclidean distance between its endpoints. The notions of Euclidean graph are theEuclidean minimum spanning tree on minimizing the total length of the segments for finite points in anyEuclidean space,Hadwiger–Nelson problem on asking for the minimum number of coloring plane such that no two points at aunit distance from each other have the same color, andshortest path problem on finding a path between two vertices in a graph that minimizes the sum of the assigned values of its edges.[29]
Avisibility graph is a graph whose vertices and edges are the point locations and visible connections, respectively. In asimple polygon, where its edges are not self-intersecting and have no holes, the vertices of a visibility graph are connected by edges that represent the sides and diagonals of a polygon. The vertices are defined as the point locations.[30]Polyhedral graph is an undirected graph that forms the vertices and edges of a three-dimensionalconvex polyhedron. In order to achieve it, such a graph must meet the requirements ofSteinitz's theorem, stating that every convex polyhedron is3-vertex connected planar graph. The planar graph remains connected whenever any two of its vertices are removed.[31]
Anintersection is a graph in which each vertex is associated with a set and in which vertices are connected by edges whenever the corresponding sets have a nonemptyintersection.[32] Each vertex is represented as a set, and every two vertices are connected. Hence, the intersection graph of finite sets can be represented through the smallest number of required elements, known as theintersection number. The result graph can be geometric whenever the sets are geometrical objects. For instance, the intersection graph of line segments in one dimension is aninterval graph. The intersection graph of unit disks in the plane is aunit disk graph. The intersection of acircle packing is acoin graph, where a vertex and an edge represent a circle and every pair of tangent circles; by Koebe–Andreev–Thurston theorem, the intersection graphs of non-crossing circles are exactly the planar graphs.[33]Scheinerman's theorem states that every planar graph can be represented as the intersection graph of line segments in the plane.
By applying toinformation visualization, this creates another subarea of graph theory that is known asgraph drawing, which visualizes a graph depiction. Frequently drawn as node–link diagrams, the vertices of a graph are represented as disks, boxes, or textual labels, and the edges are represented as line segments, polylines, or curves in the Euclidean plane.[35] Many definitions for graph drawings based on quality measures include the crossing number,[36]area, symmetry display on finding the problem of a graph's group automorphism,[37]bend minimization,angular resolution,[38] andslope number.[38] Tools for graph drawings are the circle packing,[39] the intersection graph, and other visualizations of the adjacency matrix.
Extremal graph theory is a branch of mathematics at the intersection ofextremal combinatorics and graph theory. This area studies the maximum number of a graph's edges, known as the extremal number.[40] The subarea's milestone originated from Mantel's theorem on the extremal number of atriangle-free graph.Turán's theorem extended Mantel's theorem for any undirected graph that does not have a complete subgraph of a given size. Turán's theorem is generalized byErdős–Stone theorem, which is occasionally known as the "fundamental theorem of extremal graph theory".[41]
Extremal graph theory has a central problem known as theforbidden subgraphs problem. The problem suggests finding the extremal number of a graph with vertices such that it does not have a subgraph that isisomorphic to the graph.[42]
The network graph formed by Wikipedia editors (edges) contributing to different Wikipedia language versions (vertices) during one month in summer 2013.[44]
Graphs can be used to model many types of relations and processes in physical, biological,[45][46] social and information systems.[47] Many practical problems can be represented by graphs. Emphasizing their application to real-world systems, the termnetwork is sometimes defined to mean a graph in which attributes (e.g. names) are associated with the vertices and edges, and the subject that expresses and understands real-world systems as a network is callednetwork science.
Withincomputer science, 'causal' and 'non-causal' linked structures are graphs that are used to represent networks of communication, data organization, computational devices, the flow of computation, etc. For instance, the link structure of awebsite can be represented by a directed graph, in which the vertices (nodes) represent web pages and directed edges representlinks from one page to another. A similar approach can be taken to problems in social media,[48] travel, biology, computer chip design, mapping the progression of neuro-degenerative diseases,[49][50] and many other fields. The development ofalgorithms tohandle graphs is therefore of major interest in computer science. Thetransformation of graphs is often formalized and represented bygraph rewrite systems. Complementary tograph transformation systems focusing on rule-based in-memory manipulation of graphs aregraph databases geared towardstransaction-safe,persistent storing and querying ofgraph-structured data.
Graph-theoretic methods, in various forms, have proven particularly useful inlinguistics, since natural language often lends itself well to discrete structure. Traditionally,syntax and compositional semantics follow tree-based structures, whose expressive power lies in theprinciple of compositionality, modeled in a hierarchical graph. More contemporary approaches such ashead-driven phrase structure grammar model the syntax of natural language usingtyped feature structures, which aredirected acyclic graphs. Withinlexical semantics, especially as applied to computers, modeling word meaning is easier when a given word is understood in terms of related words;semantic networks are therefore important incomputational linguistics. Still, other methods in phonology (e.g.optimality theory, which useslattice graphs) and morphology (e.g. finite-state morphology, usingfinite-state transducers) are common in the analysis of language as a graph. Indeed, the usefulness of this area of mathematics to linguistics has borne organizations such asTextGraphs, as well as various 'Net' projects, such asWordNet,VerbNet, and others.
Graph theory is also used to study molecules inchemistry andphysics. Incondensed matter physics, the three-dimensional structure of complicated simulated atomic structures can be studied quantitatively by gathering statistics on graph-theoretic properties related to the topology of the atoms. Also, "theFeynman graphs and rules of calculation summarizequantum field theory in a form in close contact with the experimental numbers one wants to understand."[51] In chemistry a graph makes a natural model for a molecule, where vertices representatoms and edgesbonds. This approach is especially used in computer processing of molecular structures, ranging fromchemical editors to database searching. Instatistical physics, graphs can represent local connections between interacting parts of a system, as well as the dynamics of a physical process on suchsystems. Similarly, incomputational neuroscience graphs can be used to represent functional connections between brain areas that interact to give rise to various cognitive processes, where the vertices represent different areas of the brain and the edges represent the connections between those areas. Graph theory plays an important role in electrical modeling of electrical networks, here, weights are associated with resistance of the wire segments to obtain electrical properties of network structures.[52] Graphs are also used to represent the micro-scale channels ofporous media, in which the vertices represent the pores and the edges represent the smaller channels connecting the pores.Chemical graph theory uses themolecular graph as a means to model molecules.Graphs and networks are excellent models to study and understand phase transitions and critical phenomena. Removal of nodes or edges leads to a critical transition where the network breaks into small clusters which is studied as a phase transition. This breakdown is studied viapercolation theory.[53]
Graph theory is also widely used insociology as a way, for example, tomeasure actors' prestige or to explorerumor spreading, notably through the use ofsocial network analysis software. Under the umbrella of social networks are many different types of graphs.[55] Acquaintanceship and friendship graphs describe whether people know each other. Influence graphs model whether certain people can influence the behavior of others. Finally, collaboration graphs model whether two people work together in a particular way, such as acting in a movie together.
Likewise, graph theory is useful inbiology and conservation efforts where a vertex can represent regions where certain species exist (or inhabit) and the edges represent migration paths or movement between the regions. This information is important when looking at breeding patterns or tracking the spread of disease, parasites or how changes to the movement can affect other species.
Graphs are also commonly used inmolecular biology andgenomics to model and analyse datasets with complex relationships. For example, graph-based methods are often used to 'cluster' cells together into cell-types insingle-cell transcriptome analysis. Another use is to model genes or proteins in apathway and study the relationships between them, such as metabolic pathways and gene regulatory networks.[56] Evolutionary trees, ecological networks, and hierarchical clustering of gene expression patterns are also represented as graph structures.
Graph theory is also used inconnectomics;[57] nervous systems can be seen as a graph, where the nodes are neurons and the edges are the connections between them.
In mathematics, graphs are useful in geometry and certain parts oftopology such asknot theory.Algebraic graph theory has close links withgroup theory. Algebraic graph theory has been applied to many areas including dynamic systems and complexity.
A graph structure can be extended by assigning a weight to each edge of the graph. Graphs with weights, orweighted graphs, are used to represent structures in which pairwise connections have some numerical values. For example, if a graph represents a road network, the weights could represent the length of each road. There may be several weights associated with each edge, including distance (as in the previous example), travel time, or monetary cost. Such weighted graphs are commonly used to program GPS's, and travel-planning search engines that compare flight times and costs.
A graph is an abstraction of relationships that emerge in nature; hence, it cannot be coupled to a certain representation. The way it is represented depends on the degree of convenience such representation provides for a certain application. The most common representations are the visual, in which, usually, vertices are drawn and connected by edges, and the tabular, in which rows of a table provide information about the relationships between the vertices within the graph.
Graphs are usually represented visually by drawing a point or circle for every vertex, and drawing a line between two vertices if they are connected by an edge. If the graph is directed, the direction is indicated by drawing an arrow. If the graph is weighted, the weight is added on the arrow.
A graph drawing should not be confused with the graph itself (the abstract, non-visual structure) as there are several ways to structure the graph drawing. All that matters is which vertices are connected to which others by how many edges and not the exact layout. In practice, it is often difficult to decide if two drawings represent the same graph. Depending on the problem domain some layouts may be better suited and easier to understand than others.
The pioneering work ofW. T. Tutte was very influential on the subject of graph drawing. Among other achievements, he introduced the use of linear algebraic methods to obtain graph drawings.
Graph drawing also can be said to encompass problems that deal with thecrossing number and its various generalizations. The crossing number of a graph is the minimum number of intersections between edges that a drawing of the graph in the plane must contain. For aplanar graph, the crossing number is zero by definition. Drawings on surfaces other than the plane are also studied.
The tabular representation lends itself well to computational applications. There are different ways to store graphs in a computer system. Thedata structure used depends on both the graph structure and thealgorithm used for manipulating the graph. Theoretically one can distinguish between list and matrix structures but in concrete applications the best structure is often a combination of both. List structures are often preferred forsparse graphs as they have smaller memory requirements.Matrix structures on the other hand provide faster access for some applications but can consume huge amounts of memory. Implementations of sparse matrix structures that are efficient on modern parallel computer architectures are an object of current investigation.[58]
List structures include theedge list, an array of pairs of vertices, and theadjacency list, which separately lists the neighbors of each vertex: Much like the edge list, each vertex has a list of which vertices it is adjacent to.
Matrix structures include theincidence matrix, a matrix of 0's and 1's whose rows represent vertices and whose columns represent edges, and theadjacency matrix, in which both the rows and columns are indexed by vertices. In both cases a 1 indicates two adjacent objects and a 0 indicates two non-adjacent objects. Thedegree matrix indicates the degree of vertices. TheLaplacian matrix is a modified form of the adjacency matrix that incorporates information about thedegrees of the vertices, and is useful in some calculations such asKirchhoff's theorem on the number ofspanning trees of a graph.Thedistance matrix, like the adjacency matrix, has both its rows and columns indexed by vertices, but rather than containing a 0 or a 1 in each cell it contains the length of ashortest path between two vertices.
There is a large literature ongraphical enumeration: the problem of counting graphs meeting specified conditions. Some of this work is found in Harary and Palmer (1973).
A common problem, called thesubgraph isomorphism problem, is finding a fixed graph as asubgraph in a given graph. One reason to be interested in such a question is that manygraph properties arehereditary for subgraphs, which means that a graph has the property if and only if all subgraphs have it too.Finding maximal subgraphs of a certain kind is often anNP-complete problem. For example:
Finding the largest complete subgraph is called theclique problem (NP-complete).
One special case of subgraph isomorphism is thegraph isomorphism problem. It asks whether two graphs are isomorphic. It is not known whether this problem is NP-complete, nor whether it can be solved in polynomial time.
A similar problem is findinginduced subgraphs in a given graph. Again, some important graph properties are hereditary with respect to induced subgraphs, which means that a graph has a property if and only if all induced subgraphs also have it. Finding maximal induced subgraphs of a certain kind is also often NP-complete. For example:
Still another such problem, the minor containment problem, is to find a fixed graph as a minor of a given graph. Aminor or subcontraction of a graph is any graph obtained by taking a subgraph and contracting some (or no) edges. Many graph properties are hereditary for minors, which means that a graph has a property if and only if all minors have it too. For example,Wagner's Theorem states:
A similar problem, the subdivision containment problem, is to find a fixed graph as asubdivision of a given graph. Asubdivision orhomeomorphism of a graph is any graph obtained by subdividing some (or no) edges. Subdivision containment is related to graph properties such asplanarity. For example,Kuratowski's Theorem states:
Another class of problems has to do with the extent to which various species and generalizations of graphs are determined by theirpoint-deleted subgraphs. For example:
Many problems and theorems in graph theory have to do with various ways of coloring graphs. Typically, one is interested in coloring a graph so that no two adjacent vertices have the same color, or with other similar restrictions. One may also consider coloring edges (possibly so that no two coincident edges are the same color), or other variations. Among the famous results and conjectures concerning graph coloring are the following:
Constraint modeling theories concern families of directed graphs related by apartial order. In these applications, graphs are ordered by specificity, meaning that more constrained graphs—which are more specific and thus contain a greater amount of information—are subsumed by those that are more general. Operations between graphs include evaluating the direction of a subsumption relationship between two graphs, if any, and computing graph unification. The unification of two argument graphs is defined as the most general graph (or the computation thereof) that is consistent with (i.e. contains all of the information in) the inputs, if such a graph exists; efficient unification algorithms are known.
Decomposition, defined as partitioning the edge set of a graph (with as many vertices as necessary accompanying the edges of each part of the partition), has a wide variety of questions. Often, the problem is to decompose a graph into subgraphs isomorphic to a fixed graph; for instance, decomposing a complete graph into Hamiltonian cycles. Other problems specify a family of graphs into which a given graph should be decomposed, for instance, a family of cycles, or decomposing a complete graphKn inton − 1 specified trees having, respectively, 1, 2, 3, ...,n − 1 edges.
Some specific decomposition problems and similar problems that have been studied include:
Arboricity, a decomposition into as few forests as possible
Cycle double cover, a collection of cycles covering each edge exactly twice
^Appel, K.; Haken, W. (1977), "Every planar map is four colorable. Part II. Reducibility",Illinois J. Math.,21 (3):491–567,doi:10.1215/ijm/1256049012.
^Robertson, N.; Sanders, D.; Seymour, P.; Thomas, R. (1997), "The four color theorem",Journal of Combinatorial Theory, Series B,70:2–44,doi:10.1006/jctb.1997.1750.
^Adali, Tulay; Ortega, Antonio (May 2018). "Applications of Graph Theory [Scanning the Issue]".Proceedings of the IEEE.106 (5):784–786.doi:10.1109/JPROC.2018.2820300.ISSN0018-9219.
^Vecchio, F (2017). ""Small World" architecture in brain connectivity and hippocampal volume in Alzheimer's disease: a study via graph theory from EEG data".Brain Imaging and Behavior.11 (2):473–485.doi:10.1007/s11682-016-9528-3.PMID26960946.S2CID3987492.
^Kumar, Ankush; Kulkarni, G. U. (2016-01-04). "Evaluating conducting network based transparent electrodes from geometrical considerations".Journal of Applied Physics.119 (1): 015102.Bibcode:2016JAP...119a5102K.doi:10.1063/1.4939280.ISSN0021-8979.
Lowell W. Beineke; Bjarne Toft; and Robin J. Wilson:Milestones in Graph Theory: A Century of Progress, AMS/MAA, (SPECTRUM, v.108), ISBN 978-1-4704-6431-8 (2025).
Berge, Claude (1958).Théorie des graphes et ses applications. Paris: Dunod. English edition, Wiley 1961; Methuen & Co, New York 1962; Russian, Moscow 1961; Spanish, Mexico 1962; Roumanian, Bucharest 1969; Chinese, Shanghai 1963; Second printing of the 1962 first English edition, Dover, New York 2001.
Biggs, Norman (1993).Algebraic Graph Theory (2nd ed.). Cambridge University Press.
Biggs, N.; Lloyd, E.; Wilson, R. (1986).Graph Theory, 1736–1936. Oxford University Press.
Bollobás, Béla; Riordan, O. M. (2003).Mathematical results on scale-free random graphs in "Handbook of Graphs and Networks" (S. Bornholdt and H.G. Schuster (eds)) (1st ed.). Weinheim: Wiley VCH.
Cvetković, Dragoš M.; Rowlinson, Peter (2004). "Spectral graph theory". In Beineke, Lowell W.; Wilson, Robin J. (eds.).Topics in Algebraic Graph Theory. Cambridge University Press.
Grünbaum, Branko (2006). "Configurations of points and lines".The Coxeter Legacy. Providence, RI: American Mathematical Society. pp. 179–225.MR2209028.
Harary, Frank (1969).Graph Theory. Reading, Massachusetts: Addison-Wesley.
Harary, Frank; Palmer, Edgar M. (1973).Graphical Enumeration. New York, New York: Academic Press.
Pach, János (2018). "Geometric Graph Theory". In Toth, Csaba D.; O'Rourke, Joseph; Goodman, Jacob E. (eds.).Handbook of Discrete and Computational Geometry (3rd ed.). CRC Press.
Pach, János;Sharir, Micha (2009). "5.5 Angular resolution and slopes".Combinatorial Geometry and Its Algorithmic Applications: The Alcalá Lectures. Mathematical Surveys and Monographs. Vol. 152.American Mathematical Society. pp. 126–127.
Thurston, William (March 2002). "§13.6, Andreev's theorem and generalizations, and §13.7, Constructing patterns of circles".The Geometry and Topology of 3-manifolds. MSRI Publications. pp. 330–346. Electronic version 1.1. Retrieved2025-12-09.
Hartmann, Alexander K.; Weigt, Martin (2005). "Introduction to graphs".Phase Transitions in Combinatorial Optimization Problems: Basics, Algorithms and Statistical Mechanics. Wiley. pp. 25–66.arXiv:cond-mat/0602129.doi:10.1002/3527606734.ch3.ISBN9783527606733.