About

Column

Graph Theory

Back to main page

Graph Theory

Graph Theory is a branch of discrete mathematics that studies graphs, which are mathematical structures used to model pairwise relations between objects. A graph consists of vertices (also called nodes) and edges (also called links) that connect pairs of vertices.

Key Concepts:

  • Vertices and Edges: The basic building blocks of a graph.

  • Types of Graphs: Includes directed, undirected, weighted, and unweighted graphs.

  • Paths and Cycles: Sequences of vertices where each pair is connected by an edge; cycles return to the starting vertex.

  • Connectivity: Describes how vertices are connected within a graph.

  • Graph Traversal: Algorithms like Depth-First Search (DFS) and Breadth-First Search (BFS) used to explore graphs.

  • Graph Coloring: Assigning colors to vertices so that no two adjacent vertices share the same color.

  • Planar Graphs: Graphs that can be drawn on a plane without edges crossing.

Applications: Graph theory is widely applied in computer science (e.g., networking, algorithms), biology (e.g., modeling neural networks), social sciences (e.g., analyzing social networks), and many other fields.

By studying graph theory, one can understand and solve complex problems related to network structures, optimization, and connectivity.

Syllabus

Column

Syllabus

Graph Theory in Discrete Mathematics

Syllabus for Graph Theory Component of a Discrete Mathematics Course

Course Description: This course covers the fundamentals of graph theory, a critical area in discrete mathematics with extensive applications in computer science, operations research, and network analysis. Students will learn about graph properties, various types of graphs, and algorithms used to solve graph-related problems. Emphasis will be placed on both theoretical understanding and practical applications.

Prerequisites:

  • Completion of an introductory Discrete Mathematics course

  • Basic understanding of mathematical proofs

Course Objectives:

  • Understand fundamental concepts and terminology of graph theory

  • Analyze and solve problems related to various types of graphs

  • Apply graph algorithms to practical problems in computer science and related fields

  • Develop skills in mathematical reasoning and proof techniques specific to graph theory


Part 1: Introduction to Graph Theory

  • Overview of graph theory and its applications

  • Basic definitions: graphs, vertices, edges

  • Types of graphs: simple, directed, undirected, weighted

Part 2: Graph Representations

  • Adjacency matrix

  • Adjacency list

  • Incidence matrix

  • Practical applications of graph representations

Part 3: Graph Traversals

  • Depth-first search (DFS)

  • Breadth-first search (BFS)

  • Applications of graph traversals

Part 4: Connectivity and Components

  • Connected and disconnected graphs

  • Strongly connected components

  • Weakly connected components

  • Applications in network analysis

Part 5: Eulerian and Hamiltonian Graphs

  • Eulerian paths and circuits

  • Hamiltonian paths and cycles

  • Algorithms to find Eulerian paths and Hamiltonian cycles

Part 6: Graph Coloring

  • Vertex coloring

  • Chromatic number

  • Applications in scheduling and register allocation

Part 7: Planar Graphs

  • Planarity and Kuratowski’s theorem

  • Euler’s formula for planar graphs

  • Graph drawing algorithms

Part 8: Trees and Spanning Trees

  • Properties of trees

  • Minimum spanning tree (MST)

  • Kruskal’s algorithm

  • Prim’s algorithm

Part 9: Network Flows

  • Maximum flow problem

  • Ford-Fulkerson algorithm

  • Applications in network routing and logistics

Part 10: Matchings and Coverings

  • Bipartite graphs

  • Maximum matching

  • Hall’s marriage theorem

  • Vertex cover and edge cover

Part 11: Advanced Topics in Graph Theory I - Graph isomorphism - Automorphisms - Cayley’s theorem

Part 12: Advanced Topics in Graph Theory II - Graph spectra and eigenvalues - Applications in chemistry and network analysis

Part 13: Algorithms and Complexity - Computational complexity of graph algorithms - NP-complete problems in graph theory - Approximation algorithms

Part 14: Applications of Graph Theory - Graph theory in computer networks - Social network analysis - Graph theory in biological networks

Graph Theory

Column

Graph Theory

Graph theory is the study of points and lines. In particular, it involves the ways in which sets of points, called vertices, can be connected by lines, called edges.

Graphs are classified according to their complexity, the number of edges allowed between any two vertices, and whether or not directions are assigned to edges.

What is Graph Theory?

Graph theory is the study of points and lines. In particular, it involves the ways in which sets of points, called , can be connected by lines or arcs, called .

Graphs are classified according to their complexity, the number of edges allowed between any two vertices, and whether or not directions (for example, up or down) are assigned to edges.

Graph theory is the study of points and lines. In particular, it involves the ways in which sets of points, called vertices, can be connected by lines or arcs, called edges. Graphs in this context differ from the more familiar coordinate plots that portray mathematical relations and functions.

Graphs are classified according to their complexity, the number of edges allowed between any two vertices, and whether or not directions (for example, up or down) are assigned to edges. Various sets of rules result in specific properties that can be stated as theorems.

Graph theory has proven useful in the design of integrated circuits ( IC s) for computers and other electronic devices. These components, more often called chip s, contain complex, layered microcircuits that can be represented as sets of points interconnected by lines or arcs.

Using graph theory, engineers develop chips with maximum component density and minimum total interconnecting conductor length. This is important for optimizing processing speed and electrical efficiency.

Adjacency

  • An representation of a graph is a collection of unordered lists, one for each vertex in the graph. Each list describes the set of neighbors of its vertex.

  • An is a means of representing which vertices (or nodes) of a graph are adjacent to which other vertices. Another matrix representation for a graph is the incidence matrix.

Isomorphism

  • They have a different number of connected components
  • They have a different number of vertices
  • They have different degrees sequences
  • They have a different number of paths of any given length
  • They have a different number of cycles of any length.

Degree Sequences

Density and Average Degree

The density of a graph G = (V,E) measures how many edges are in set E compared to the maximum possible number of edges between vertices in set V. Density is calculated as follows:

  • An undirected graph has no loops and can have at most |V| * (|V| − 1) / 2 edges, so the density of an undirected graph is 2 * |E| / (|V| * (|V| − 1)).
  • A directed graph has no loops and can have at most |V| * (|V| − 1) edges, so the density of a directed graph is |E| / (|V| * (|V| − 1))

The average degree of a graph G is another measure of how many edges are in set E compared to number of vertices in set V. Because each edge is incident to two vertices and counts in the degree of both vertices, the average degree of an undirected graph is 2*|E|/|V|.

Types of Graphs

Column

Types of Graphs

Directed Graphs

A directed graph is a graph where the arcs are one-directional, that is an arc between two nodes only indicates the possibility of moving from one node to the other, but not in the opposite direction. The arcs will usually be drawn as arrows to indicate the direction. An example of a potential use for a directed graph would be a graph which tracks possible states that a computer could be in; there may be a way for a computer in one state to reach a subsequent state, but no way to return from the second state to the first.

Weighted graph

A weighted graph is a graph where there is some ‘cost’ associated with each arc. Usually, a little number will appear directly adjacent to every arc to express this price. A typical use of a weighted graph would be planning routes between locations on a map where the ‘cost’ associated with the arc would be the distance between the two locations.

Trees

A tree is a special graph which is connected (every node can be reached from every other node by following one or more arcs) and for which the number of arcs is exactly one fewer than the number of nodes. A tree is usually drawn with one node (called the ‘root node’) at the top of the diagram, and then ‘growing’ downwards with arcs and nodes getting further and further from the root. In this way, nodes can be grouped in terms of their distance from the root. Every node (aside from the root) is referred to as the ‘child’ of the node to which it is connected and which is one step closer to the root. This node is also called the ‘parent’ node of the child. Every node has at most one parent but can have any number of children. Nodes without any children are commonly called ‘leaf nodes’. A typical use of a tree would be a decision problem where the answer to a question determines the next question and set of possible answers.

Planar Graphs

A planar graph is a graph that can be drawn in the plane such that there are no edge crossings.

Characterization

The planar graphs can be characterized by a theorem first proven by Kazimierz Kuratowski in 1930, which states that the planar graphs are exactly those graphs G such that \(K_5 \not \preceq G\) and \(K_{3,3</h5> \not \preceq G\) .

Types of Graph Layouts
  1. Bipartite Graphs
  2. Path Graphs
  3. Cycle Graphs
  4. Null Graphs
Bipartite Graphs
  • A bipartite graph is a graph whose vertex-set can be split into two sets in such a way that each edge of the graph joins a vertex in first set to a vertex in second set.
Path Graphs
  • A path graph is a graph consisting of a single path.
  • The path graph with n vertices is denoted by \(P_n\).
Cycle Graphs
  • A cycle graph is a graph consisting of a single cycle.
  • The cycle graph with n vertices is denoted by \(C_n\).
Null Graphs
  • A null graphs is a graph containing no edges. * The null graph with n vertices is denoted by \(N_n\).

There are various types of graphs depending upon the number of vertices, number of edges, interconnectivity, and their overall structure. We will discuss only a certain few important types of graphs in this chapter.

Planar Graphs

Euler’s Formula

Let \(G\) be a connected planar graph, and let V, E and R denote, respectively, the numbers of vertices, edges, and regions in a plane drawing of G. Then \(V - E + R = 2\).

Paths and Cycles in Graphs

Column

Paths and Cycles in Graphs

In graph theory, the degree sequence of a graph is a list of the degrees of its vertices, usually written in non-increasing order. The degree of a vertex is the number of edges incident to it.

Essentially, the degree sequence provides a summary of the graph’s structure by indicating how many connections (or edges) each vertex (or node) has.

Example

Consider a simple graph with the following vertices and edges: - Vertices: \(V = \{A, B, C, D, E\}\) - Edges: \(E = \{(A, B), (A, C), (B, D), (C, D), (D, E)\}\)

The degrees of the vertices are: - Vertex \(A\): 2 edges (connected to \(B\) and \(C\)) - Vertex \(B\): 2 edges (connected to \(A\) and \(D\)) - Vertex \(C\): 2 edges (connected to \(A\) and \(D\)) - Vertex \(D\): 3 edges (connected to \(B\), \(C\), and \(E\)) - Vertex \(E\): 1 edge (connected to \(D\))

The degree sequence is therefore: \[ (3, 2, 2, 2, 1) \]

Significance

  • Graph Realizability: A sequence of non-negative integers is the degree sequence of some graph if and only if it satisfies certain conditions (like the Erdős–Gallai theorem). This is useful in graph construction and network analysis.
  • Graph Properties: The degree sequence can provide insights into various properties of the graph, such as its connectivity, centrality, and potential existence of certain subgraphs.

Types of Graphs

Column

Regular Graphs

In graph theory, a regular graph is a graph where each vertex has the same number of edges, meaning that every vertex has the same degree. If every vertex in the graph has degree \(k\), the graph is called a \(k\)-regular graph or simply a regular graph of degree \(k\).

Key Points:

  • Degree: The number of edges incident to a vertex.
  • \(k\)-Regular Graph: A graph where every vertex has degree \(k\).

Examples:

  • 3-Regular Graph: In a 3-regular graph, each vertex is connected to exactly three other vertices.
  • Complete Graph: A complete graph with \(n\) vertices (\(K_n\)) is \((n-1)\)-regular because every vertex is connected to every other vertex.

Regular graphs are important in various fields, including network design and error-correcting codes, due to their uniform structure.

Planar Graphs

In graph theory, a planar graph is a graph that can be embedded in the plane, meaning it can be drawn on a flat surface without any of its edges crossing each other. Here are some key points about planar graphs:

Characteristics of Planar Graphs:

  1. No Edge Crossings: A planar graph can be drawn in such a way that no two edges intersect except at their endpoints.
  2. Faces: In a planar graph, the regions enclosed by the edges are called faces. The unbounded region surrounding the graph is also considered a face.
  3. Euler’s Formula: For a connected planar graph with \(V\) vertices, \(E\) edges, and \(F\) faces, Euler’s formula holds: \[ V - E + F = 2 \]

Examples of Planar Graphs:

  • Trees: All trees are planar graphs because they can be drawn without edge crossings.
  • Cycle Graphs: Simple cycle graphs (like triangles and quadrilaterals) are planar.
  • Graph with small numbers of edges: Graphs with few edges relative to the number of vertices are often planar.

Non-Planar Graphs:

  • Kuratowski’s Theorem: A graph is non-planar if it contains a subgraph that is homeomorphic to \(K_5\) (complete graph on 5 vertices) or \(K_{3,3}\) (complete bipartite graph on 6 vertices, partitioned into two sets of 3).
  • Example of Non-Planar Graphs: \(K_5\) and \(K_{3,3}\) are classical examples of non-planar graphs.

Applications:

Planar graphs are used in various fields such as network design, geography (map coloring), and computer graphics. They simplify problems involving circuit layout, urban planning, and geographical information systems.

Connectivity

Column

Graph Connectivity

Connectivity

Whether or not it is possible to traverse a graph from one vertex to another is dependent on how connected a graph is.

Definition of Connectedness

  • If there is a u-v path in G, then we say that u and v are connected
  • If there is a u-v path for every pair of vertices u and v in G, then we say that \(G\) is connected

Theorems on Connectedness

Theorem: Let G be a graph of order at least 3. If there are distinct vertices u and v in G so that G-u and G-v are both connected, then G is also connected. Proof: Let w be a G vertex, which is different from both u and v. We want to prove connectedness, i.e., that for every pair (x,y) of vertices in G, there is an x-y walk in G. We may consider three (partly overlapping) cases:

  • If neither x nor y is u, then there is an x-y walk in G-u, and this also is an x-y walk in G.
  • If neither x nor y is v, then there is an x-y walk in G-v, and this also is an x-y walk in G.
  • If \({x,y} = {u,v}\), then employ the first two cases in order to see that there is a u-w walk and a w-v walk. Combining them indeed yields a u-v walk.

Vertex and Edge Connectivity

A graph G is called k-connected if for every \({\displaystyle S\subseteq V(G)}\), and ${|S|<k} $, \({\displaystyle G-S}\) is connected, and \({\displaystyle |G|>k}\).

Similarly, a graph G is called $ℓ {} $ edge-connected if for every \({\displaystyle S\subseteq E(G)}\) , and $ {|S|<} $ , G − S {G-S} is connected, and ${|G|>1} $ . The connectivity of G is the greatest k such that G is k-connected, and is denoted by ${(G)} $ . Relatedly, the edge-connectivity of G is the greatest ℓ {} such that G is ℓ {} edge-connected, and is denoted by \({\displaystyle \lambda (G)}\).

Theorems on Connectivity[edit]

Theorem: Let G be a k-connected graph. Then, ∀ i ∈ N , 0 ≤ i ≤ k {i ,0ik} , G is i-connected. Proof: Since G is k-connected, for all \({\displaystyle S\subseteq V(G),|S|<k}\), \({\displaystyle G-S}\) is connected. Then, since \({\displaystyle i\leq k}\) , for all ${SV(G),|S|<ik} $ , G − S {G-S} is also connected.

Theorem: Let G be a nontrivial graph. Then, \({\displaystyle \lambda (G)\leq \delta (G)}\).

Proof:

  • Take v a vertex of degree \({\displaystyle \delta (G)}\) in \(G\).
  • Then, removing all edges in G that are incident with v disconnects v from the rest of the graph, provided that \({\displaystyle |G|>\delta (G)+1}\).
  • Therefore, G cannot be \({\displaystyle \delta (G)}\) edge-connected, and so \({\displaystyle \lambda (G)\leq \delta (G)}\).

Exercise: Connectivity

If G is $ {} $ edge-connected, show that G is also i edge-connected \({\displaystyle \forall i\in \mathbb {N} ,0\leq i\leq \ell }\) .

Isomorphic Graphs

Column

Isomorphic Graphs

Isomorphic Graphs
  • The two graphs have different numbers of vertices.

  • The two graphs have different numbers of edges.

  • One graph has parallel edges and the other does not.

  • One graph has a loop and the other does not.

  • One graph has a vertice of degree \(k\) (for example) and the other does not.

  • One graph is connected and the other is not.

  • One graph has a cycle and the other has not.

  • They have a different number of connected components

  • They have a different number of vertices

  • They have different degrees sequences

  • They have a different number of paths of any given length

  • They have a different number of cycles of any length.

Graph Traversal

Depth-First Search (DFS) and Breadth-First Search (BFS)

Depth-First Search (DFS) and Breadth-First Search (BFS) are two fundamental graph traversal algorithms used to explore nodes and edges of a graph. Each algorithm follows a distinct strategy to visit all vertices of a graph.

Depth-First Search (DFS)

DFS Strategy: DFS explores a graph by going as deep as possible along each branch before backtracking. This approach uses a stack (LIFO structure) to keep track of the vertices to be explored.

DFS Algorithm: 1. Start at the root (or any arbitrary node). 2. Push the starting node onto the stack. 3. Pop the top node from the stack and mark it as visited. 4. Push all adjacent unvisited nodes of the current node onto the stack. 5. Repeat steps 3 and 4 until the stack is empty.

Example: Consider the following graph:

A - B - D
|   |
C   E

Starting from vertex A, the DFS traversal order would be: A -> C -> B -> E -> D.

Applications of DFS: - Detecting cycles in a graph - Topological sorting - Solving puzzles like mazes - Pathfinding algorithms

Breadth-First Search (BFS)

BFS Strategy: BFS explores a graph level by level, visiting all neighbors of a vertex before moving on to the next level. This approach uses a queue (FIFO structure) to keep track of the vertices to be explored.

BFS Algorithm: 1. Start at the root (or any arbitrary node). 2. Enqueue the starting node. 3. Dequeue a node from the front of the queue and mark it as visited. 4. Enqueue all adjacent unvisited nodes of the current node. 5. Repeat steps 3 and 4 until the queue is empty.

Example: Consider the same graph:

A - B - D
|   |
C   E

Starting from vertex A, the BFS traversal order would be: A -> B -> C -> D -> E.

Applications of BFS: - Finding the shortest path in an unweighted graph - Level order traversal of a tree - Solving problems like the shortest path in a maze - Web crawlers and network broadcasting

Comparing DFS and BFS

  • DFS goes deep into a graph, while BFS explores each level of a graph.

  • DFS uses a stack, while BFS uses a queue.

  • DFS can be implemented using recursion or an explicit stack, while BFS relies on an explicit queue.

  • BFS is better for finding the shortest path in an unweighted graph, while DFS is useful for tasks like topological sorting and cycle detection.

I hope this gives you a clear understanding of DFS and BFS! Let me know if you need further details or examples.

Graph Theory - Worksheet 1

Column

Work Sheet 1

Question 1

  1. Let G be a graph and let v be a vertex of G. Say what is meant by the degree of v.

  2. A graph is called k-regular if each of its vertices has degree k. Construct an example of:

  3. a 2-regular graph with 5 vertices,

  1. a 3-regular graph with 6 vertices.

  2. State, without proving, a result connecting the degrees of the vertices of a graph G with the number of its edges.

  3. Use the result in part (c) to find the number of edges of a 3-regular graph with 10 vertices

  4. Explain why it is not possible to construct a 3-regular graph with 9 vertices.


Question 2

Draw the graph , which has the vertices \(v_1\),\(v_2\),\(v_3\),\(\ldots\),\(v_7\), and the adjacency list:


Question 3

Given the following definitions for simple, connected graphs:

  • \(K_n\) is a graph on \(n\) vertices where each pair of vertices is connected by an edge;
  • \(C_n\) is the graph with vertices \(v_1, v_2, v_3, \dots, v_n\) and edges \(\{v_1,v_2\}, \{v_2,v_3\}, \dots\{v_n, v_1\}\);
  • \(W_n\) is the graph obtained from \(C_n\) by adding an extra vertex,\(v_{n+1}\), and edges from this to each of the original vertices in \(C_n\).

Draw \(K_4\), \(C_4\), and \(W_4\).


Question 4

  1. A simple, connected graph has 7 vertices, all having the same degree d. State the possible values of d and for each value also give the number of edges in the corresponding graph.
  2. Another simple, connected graph has 6 vertices, all having the same degree, n.  Draw such a graph when n = 3 and state the other possible values of n.