Unit 14: Introduction to Graph Theory

Contents

1. Definition of Graphs, Vertices, and Edges

A Graph (G) is a mathematical structure consisting of two sets: a set of Vertices (V) (also called nodes) and a set of Edges (E) that connect pairs of vertices.

Formal Notation: G = (V, E).
Example: V = \{v1, v2, v3\}, E = \{(v1, v2), (v2, v3)\}.

2. Types of Graphs

Graphs are classified based on the nature of their edges and connections:

Type Description
Undirected Graph Edges have no direction (connection is two-way).
Directed Graph (Digraph) Edges have a specific direction (represented by arrows).
Simple Graph A graph with no self-loops and no multiple edges between the same vertices.
Complete Graph (Kn) A graph where every vertex is connected to every other vertex exactly once.

3. Degree of a Vertex

The Degree of a vertex is the number of edges incident (connected) to it. For directed graphs, we distinguish between In-degree (arrows coming in) and Out-degree (arrows going out).

Handshaking Lemma: The sum of the degrees of all vertices in a graph is twice the number of edges.
∑ deg(v) = 2 × |E|

4. Paths and Connectivity

5. Introduction to Trees

A Tree is a special type of connected graph that has no cycles. Trees are fundamental in computer science for organizing data (like folder structures or HTML DOM).

Properties of a Tree:

  1. If a tree has n vertices, it must have exactly n-1 edges.
  2. There is exactly one unique path between any two vertices.
  3. Adding any one edge to a tree creates exactly one cycle.

6. Exam Focus Enhancements

Exam Tips
Common Mistakes
Frequently Asked Questions

Q: What is an Isolated Vertex?
A: A vertex with a degree of 0 (no connections).

Q: What is a Pendant Vertex?
A: A vertex with a degree of 1 (a "leaf" in a tree).

Q: Why is Graph Theory important for BCA?
A: It is used in networking (topology), database management (relationships), and algorithm design (pathfinding).