Basic graph definitions: Difference between revisions
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
# A node and an arc/edge are called '''incident''' if the node belongs to the arc/edge. | # A node and an arc/edge are called '''incident''' if the node belongs to the arc/edge. | ||
# For a node, the number of incident arcs/edges is the '''degree''' of this node. | # For a node, the number of incident arcs/edges is the '''degree''' of this node. | ||
# Consider a directed graph <math>G=(V | # Consider a directed graph <math>G=(V,A)</math> and a node <math>v\in V</math>: | ||
## An arc <math>(v,w)\in A</math> is an '''outgoing arc''' of <matH>v</math>, and an arc <math>(w,v)\in A</math> is an '''incoming arc''' of <math>v</math>. | ## An arc <math>(v,w)\in A</math> is an '''outgoing arc''' of <matH>v</math>, and an arc <math>(w,v)\in A</math> is an '''incoming arc''' of <math>v</math>. | ||
## The '''outdegree''' of <math>v</math> is the number of its outgoing arcs, the '''indegree''' of <math>v</matH> is the number of its incoming arcs. | ## The '''outdegree''' of <math>v</math> is the number of its outgoing arcs, the '''indegree''' of <math>v</matH> is the number of its incoming arcs. |
Revision as of 10:28, 20 October 2014
Directed and undirected graphs
- A directed graph [math]\displaystyle{ G=(V,A) }[/math] consists of a finite set [math]\displaystyle{ V }[/math] of nodes (a.k.a. vertices) and a multiset [math]\displaystyle{ A }[/math] of ordered pairs of nodes. The elements of [math]\displaystyle{ A }[/math] are the arcs of [math]\displaystyle{ G }[/math].
- An undirected graph [math]\displaystyle{ G=(V,E) }[/math] consists of a finite set [math]\displaystyle{ V }[/math] of nodes (a.k.a. vertices) and a multiset [math]\displaystyle{ E }[/math] of unordered pairs of nodes, the edges of [math]\displaystyle{ G }[/math].
- A directed or undirected graph is simple, if:
- No node is paired with itself in [math]\displaystyle{ A }[/math] and [math]\displaystyle{ E }[/math], respectively.
- The multisets [math]\displaystyle{ A }[/math] and [math]\displaystyle{ E }[/math], respectively, are sets.
- A directed graph [math]\displaystyle{ G=(V,A) }[/math] is symmetric if [math]\displaystyle{ (v,w)\in A }[/math] implies [math]\displaystyle{ (w,v)\in A }[/math], and anti-symmetric if [math]\displaystyle{ (v,w)\in A }[/math] implies [math]\displaystyle{ (w,v)\not\in A }[/math].
Adjacency, incidence, and degree
- Two nodes of a directed or undirected graph are called adjacent if they share at least one arc/edge.
- A node and an arc/edge are called incident if the node belongs to the arc/edge.
- For a node, the number of incident arcs/edges is the degree of this node.
- Consider a directed graph [math]\displaystyle{ G=(V,A) }[/math] and a node [math]\displaystyle{ v\in V }[/math]:
- An arc [math]\displaystyle{ (v,w)\in A }[/math] is an outgoing arc of [math]\displaystyle{ v }[/math], and an arc [math]\displaystyle{ (w,v)\in A }[/math] is an incoming arc of [math]\displaystyle{ v }[/math].
- The outdegree of [math]\displaystyle{ v }[/math] is the number of its outgoing arcs, the indegree of [math]\displaystyle{ v }[/math] is the number of its incoming arcs.
Representations of graphs
We focus on directed graphs because an undirected graph is usually represented as a symmetric directed graph as introduced above. Let and . We denote and .
- Adjacency matrix: an -matrix such that, for ,
if , and if .
- Incidence matrix: an -matrix such that, for and , it is
if for some , if for some ,
, otherwise.
- Incidence list: a sequence of length . For , is a sequence of arcs and contains all outgoing arcs of .
Connectedness
An undirected graph is said to be connected if, for each pair of nodes, there is a path connecting this pair. A directed graph is said to be weakly connected if, for each pair of nodes, there is a generalized path connecting this pair. A directed graph is said to be strongly connected if, for each pair of nodes, there is a path connecting this pair.