Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Graph (discrete mathematics)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Definitions == Definitions in graph theory vary. The following are some of the more basic ways of defining graphs and related [[mathematical structure]]s. === {{anchor|Undirected graph}} Graph === [[File:Undirected.svg|thumb|upright|A graph with three vertices and three edges]] A '''graph''' (sometimes called an ''undirected graph'' to distinguish it from a [[#Directed graph|directed graph]], or a ''simple graph'' to distinguish it from a [[multigraph]]){{sfn|Bender|Williamson|2010|p=148}}<ref>See, for instance, Iyanaga and Kawada, ''69 J'', p. 234 or Biggs, p. 4.</ref> is a [[ordered pair|pair]] {{math|1=''G'' = (''V'', ''E'')}}, where {{mvar|V}} is a set whose elements are called ''vertices'' (singular: vertex), and {{mvar|E}} is a set of unordered pairs <math>\{v_1, v_2\}</math> of vertices, whose elements are called ''edges'' (sometimes ''links'' or ''lines''). The vertices {{mvar|u}} and {{mvar|v}} of an edge {{math|{''u'', ''v''} }} are called the edge's ''endpoints''. The edge is said to ''join'' {{mvar|u}} and {{mvar|v}} and to be ''incident'' on them. A vertex may belong to no edge, in which case it is not joined to any other vertex and is called ''isolated''. When an edge <math>\{u,v\}</math> exists, the vertices {{mvar|u}} and {{mvar|v}} are called ''adjacent''. A [[multigraph]] is a generalization that allows multiple edges to have the same pair of endpoints. In some texts, multigraphs are simply called graphs.{{sfn|Bender|Williamson|2010|p=149}}<ref>Graham et al., p. 5.</ref> Sometimes, graphs are allowed to contain ''[[Loop (graph theory)|loop]]s'', which are edges that join a vertex to itself. To allow loops, the pairs of vertices in {{mvar|E}} must be allowed to have the same node twice. Such generalized graphs are called ''graphs with loops'' or simply ''graphs'' when it is clear from the context that loops are allowed. Generally, the vertex set {{mvar|V}} is taken to be finite (which implies that the edge set {{mvar|E}} is also finite). Sometimes [[infinite graph]]s are considered, but they are usually viewed as a special kind of [[binary relation]], because most results on finite graphs either do not extend to the infinite case or need a rather different proof. An [[empty graph]] is a graph that has an [[empty set]] of vertices (and thus an empty set of edges). The ''order'' of a graph is its number {{math|{{abs|''V''}}}} of vertices, usually denoted by {{mvar|n}}. The ''size'' of a graph is its number {{math|{{abs|''E''}}}} of edges, typically denoted by {{mvar|m}}. However, in some contexts, such as for expressing the [[computational complexity]] of algorithms, the term ''size'' is used for the quantity {{math|{{abs|''V''}} + {{abs|''E''}}}} (otherwise, a non-empty graph could have size 0). The ''degree'' or ''valency'' of a vertex is the number of edges that are incident to it; for graphs with loops, a loop is counted twice. In a graph of order {{math|''n''}}, the maximum degree of each vertex is {{math|''n'' β 1}} (or {{math|''n'' + 1}} if loops are allowed, because a loop contributes 2 to the degree), and the maximum number of edges is {{math|''n''(''n'' β 1)/2}} (or {{math|''n''(''n'' + 1)/2}} if loops are allowed). The edges of a graph define a [[symmetric relation]] on the vertices, called the ''adjacency relation''. Specifically, two vertices {{mvar|x}} and {{mvar|y}} are ''adjacent'' if {{math|{''x'', ''y''} }} is an edge. A graph is fully determined by its [[adjacency matrix]] {{mvar|A}}, which is an {{math|''n'' Γ ''n''}} square matrix, with {{mvar|A{{sub|ij}}}} specifying the number of connections from vertex {{mvar|i}} to vertex {{mvar|j}}. For a simple graph, {{math|''A{{sub|ij}}''}} is either 0, indicating disconnection, or 1, indicating connection; moreover {{math|1=''A{{sub|ii}}'' = 0}} because an edge in a simple graph cannot start and end at the same vertex. Graphs with self-loops will be characterized by some or all {{mvar|A{{sub|ii}}}} being equal to a positive integer, and multigraphs (with multiple edges between vertices) will be characterized by some or all {{mvar|A{{sub|ij}}}} being equal to a positive integer. Undirected graphs will have a [[symmetric matrix|symmetric]] adjacency matrix (meaning {{math|1=''A{{sub|ij}}'' = ''A{{sub|ji}}''}}). === Directed graph === {{main|Directed graph}} [[File:Directed.svg|thumb|upright|A directed graph with three vertices and four directed edges, where the double arrow represents two directed edges in opposite directions]] A '''directed graph''' or '''digraph''' is a graph in which edges have orientations. In one restricted but very common sense of the term,{{sfn|Bender|Williamson|2010|p=161}} a '''directed graph''' is a pair {{math|1=''G'' = (''V'', ''E'')}} comprising: * {{mvar|V}}, a [[Set (mathematics)|set]] of ''vertices'' (also called ''nodes'' or ''points''); * {{mvar|E}}, a [[Set (mathematics)|set]] of ''edges'' (also called ''directed edges'', ''directed links'', ''directed lines'', ''arrows'', or ''arcs''), which are [[ordered pair]]s of distinct vertices: <math>E \subseteq \{(x,y) \mid (x,y) \in V^2 \;\textrm{ and }\; x \neq y \}</math>. To avoid ambiguity, this type of object may be called precisely a '''directed simple graph'''. In the edge {{math|(''x'', ''y'')}} directed from {{mvar|x}} to {{mvar|y}}, the vertices {{mvar|x}} and {{mvar|y}} are called the ''endpoints'' of the edge, {{mvar|x}} the ''tail'' of the edge and {{mvar|y}} the ''head'' of the edge. The edge is said to ''join'' {{mvar|x}} and {{mvar|y}} and to be ''incident'' on {{mvar|x}} and on {{mvar|y}}. A vertex may exist in a graph and not belong to an edge. The edge {{math|(''y'', ''x'')}} is called the ''inverted edge'' of {{math|(''x'', ''y'')}}. ''[[Multiple edges]]'', not allowed under the definition above, are two or more edges with both the same tail and the same head. In one more general sense of the term allowing multiple edges,{{sfn|Bender|Williamson|2010|p=161}} a directed graph is sometimes defined to be an ordered triple {{math|1=''G'' = (''V'', ''E'', ''Ο'')}} comprising: * {{mvar|V}}, a [[Set (mathematics)|set]] of ''vertices'' (also called ''nodes'' or ''points''); * {{mvar|E}}, a [[Set (mathematics)|set]] of ''edges'' (also called ''directed edges'', ''directed links'', ''directed lines'', ''arrows'' or ''arcs''); * {{mvar|Ο}}, an ''incidence function'' mapping every edge to an [[ordered pair]] of vertices (that is, an edge is associated with two distinct vertices): <math>\phi : E \to \{(x,y) \mid (x,y) \in V^2 \;\textrm{ and }\; x \neq y \}</math>. To avoid ambiguity, this type of object may be called precisely a '''directed multigraph'''. A ''[[Loop (graph theory)|loop]]'' is an edge that joins a vertex to itself. Directed graphs as defined in the two definitions above cannot have loops, because a loop joining a vertex <math>x</math> to itself is the edge (for a directed simple graph) or is incident on (for a directed multigraph) <math>(x,x)</math> which is not in <math>\{(x,y) \mid (x,y) \in V^2 \;\textrm{ and }\; x \neq y \}</math>. So to allow loops the definitions must be expanded. For directed simple graphs, the definition of <math>E</math> should be modified to <math>E \subseteq V^2</math>. For directed multigraphs, the definition of <math>\phi</math> should be modified to <math>\phi : E \to V^2</math>. To avoid ambiguity, these types of objects may be called precisely a '''directed simple graph permitting loops''' and a '''directed multigraph permitting loops''' (or a ''[[Quiver (mathematics)|quiver]]'') respectively. The edges of a directed simple graph permitting loops {{mvar|G}} is a [[Binary relation#Homogeneous relation|homogeneous relation]] ~ on the vertices of {{mvar|G}} that is called the ''adjacency relation'' of {{mvar|G}}. Specifically, for each edge {{math|(''x'', ''y'')}}, its endpoints {{mvar|x}} and {{mvar|y}} are said to be ''adjacent'' to one another, which is denoted {{math|''x'' ~ ''y''}}. === Mixed graph === {{main|Mixed graph}} [[File:Example of simple mixed graph.jpg|thumb|upright|A mixed graph with three vertices, two directed edges, and an undirected edge.]] A ''mixed graph'' is a graph in which some edges may be directed and some may be undirected. It is an ordered triple {{math|1=''G'' = (''V'', ''E'', ''A'')}} for a ''mixed simple graph'' and {{math|1=''G'' = (''V'', ''E'', ''A'', ''Ο{{sub|E}}'', ''Ο{{sub|A}}'')}} for a ''mixed multigraph'' with {{mvar|V}}, {{mvar|E}} (the undirected edges), {{mvar|A}} (the directed edges), {{mvar|Ο{{sub|E}}}} and {{mvar|Ο{{sub|A}}}} defined as above. Directed and undirected graphs are special cases. === Weighted graph === [[File:Weighted_network.svg|thumb|upright=1.2|A weighted graph with ten vertices and twelve edges]] A ''weighted graph'' or a ''network''<ref>{{Citation | last=Strang | first=Gilbert | title=Linear Algebra and Its Applications | publisher=Brooks Cole | edition=4th | year=2005 | isbn=978-0-03-010567-8 }}</ref><ref>{{Citation | last=Lewis | first=John | title=Java Software Structures | publisher=Pearson | edition=4th | year=2013 | isbn=978-0133250121 | page=405 }}</ref> is a graph in which a number (the weight) is assigned to each edge.<ref>{{cite book|last1=Fletcher|first1=Peter|last2=Hoyle|first2=Hughes|last3=Patty|first3=C. Wayne|title=Foundations of Discrete Mathematics|year=1991|publisher=PWS-KENT Pub. Co.| location=Boston| isbn=978-0-53492-373-0| pages=463 | edition=International student|quote=A ''weighted graph'' is a graph in which a number ''w''(''e''), called its ''weight'', is assigned to each edge ''e''.}}</ref> Such weights might represent for example costs, lengths or capacities, depending on the problem at hand. Such graphs arise in many contexts, for example in [[shortest path problem]]s such as the [[traveling salesman problem]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)