GF1: Review of Graphs & Digraphs
San Skulrattanakulchai
November 1, 2018
Definitions
- DPV: Ch 3.1
- A graph (digraph) \(G=(V,E)\) consists of a finite set \(V\) of vertices or nodes and a set \(E\) of unordered (ordered) pairs of vertices called edges. In all our discussion about graphs (digraphs) \(n\) denotes the number of vertices and \(m\) denotes the number of edges.
- Vertex \(u\) in an undirected graph is adjacent to or is a neighbor of vertex \(v\) if \(e=\{u, v\}\) is an edge, in which case we also say that edge \(e\) is incident to or incident with vertex \(u\).
- Let \(e=(u,v)\) be an edge in a digraph. We say that vertex \(u\) is adjacent to vertex \(v\); vertex \(v\) is adjacent from vertex \(u\); and edge \(e\) leaves or is incident from \(u\) and enters or is incident to \(v\).
- A graph (digraph) is called complete if it contains all possible edges, i.e., any vertex is adjacent to every other vertex. A complete graph has \(m = n(n-1)/2\). A complete digraph has \(m=n^2\).
- A vertex is said to be isolated if it is on no edge.
Definitions, continued
- We normally assume our graphs contain no isolated vertices since in most applications isolated vertices do not affect the main algorithm. This implies \(m\ge n/2\).
- In general, \(m\) is \(\Omega(n)\) and \(m\) is \(O(n^2)\).
- Graphs with \(\Theta(n)\) edges are called sparse, those with \(\Theta(n^2)\) edges are called dense. Examples of sparse graphs are the grid graphs and planar graphs.
- Graph \(H\) is a subgraph of \(G\) if \(V(H)\subseteq V(G)\) and \(E(H)\subseteq E(G)\).
- A path \(P\) is a sequence of vertices \(v_0,v_1,\ldots, v_k\) (or \(v_0\rightarrow v_1\rightarrow\cdots\rightarrow v_k\)) for some \(k\ge0\) with \(v_{i}\) adjacent to \(v_{i+1}\) for all \(0\le i< k\). The length of the path \(P\) is \(k\). A path is simple if it repeats no vertex.
- The degree of a vertex in an undirected graph is the number of edges incident to it.
- The indegree (outdegree) of a vertex in a digraph is the number of edges that enters (leaves) it.
Fundamental theorem
- Theorem. In an undirected graph the degrees sum to \(2m\). In a digraph the indegrees (outdegrees) sum to \(m\).
Connectedness
- An undirected graph is connected if for any two vertices there is a path from one vertex to the other.
- A connected component of a graph is a (vertex- and edge-) maximal connected subgraph.
- Examples: The 15-tiles puzzle has \(16! \approx 2 \times 10^{13}\) vertices. It has 2 connected components, each with \(\approx 10^{13}\) vertices.
- A forest is a graph with no cycle.
- A tree is a connected forest. Any tree can be rooted by making some vertex \(r\) distinquished. Vertex \(r\) then becomes the root.
Spanning trees
- Every connected undirected graph \(G\) has a spanning tree, i.e., a subgraph without cycle and containing every vertex of \(G\).
- Examples: …
Graph operations
- Deleting edge \(e\) from (di)graph \(G\) means forming the (di)graph \(G-e\) having all edges of \(G\) except \(e\)
- Examples: …
- Deleting vertex \(v\) from graph (digraph) \(G\) means forming the graph \(G-v\) having all edges of \(G\) except \(v\) and all edges of \(G\) except those incident to (to or from) \(v\).
- Examples: …
- Contracting a set of vertices \(S\) means forming the graph (digraph) \(G/S\) where the vertices \(S\) are replaced by a new vertex \(\Sigma\), adjacent to (to or from) every neighbor of \(S\).
- Examples: …
- Contracting an edge \(e\) means contracting the two ends of \(e\).
Notes
- Multigraphs and multidigraphs are like graphs and digraphs except that multiple edges joining the same pair of vertices are allowed. All graph-theoretic definitions made here can be straightforwardly generalized to multigraphs and multidigraphs.
- An edge from any vertex \(v\) to itself is called a self-loop. Self-loops are generally not allowed in a graph or digraph, but are usually allowed in multigraphs and multidigraphs.
- There are many different terminologies in current use in Graph Theory literature. Worse still, the same term is often used to mean different things by different authors. Make sure you know what your author means!