Graphs: Definition and Types
Core Titles
Key headlines and terms for quick recall- Graph
- Simple graph, Multigraph, Pseudograph
- Directed (digraph) vs Undirected
- Complete graph — every pair joined
- Bipartite
- Regular graph — all vertices same degree
- Subgraph, Spanning subgraph
- Degree ; Handshaking lemma
Basic Idea
What it is, why it matters, how it worksWhat is a graph?
A graph is a pair where is a set of vertices and is a set of edges connecting them. Graphs model anything pairwise — networks, maps, social ties.
Common types
- Simple graph — no self-loops, no multi-edges.
- Multigraph — multiple edges allowed between the same pair.
- Pseudograph — multi-edges and self-loops allowed.
- Directed graph (digraph) — edges have direction (arrows).
- Weighted graph — edges carry numeric weights.
Special graphs
- Complete graph : every pair of vertices connected. Has edges.
- Bipartite graph: , edges only between and .
- Complete bipartite : edges.
- Regular graph: every vertex has the same degree .
- Null graph: no edges.
Degree and handshaking
The degree of vertex , , is the number of edges incident to it (self-loops count twice).
Handshaking lemma. .
Corollary: The number of odd-degree vertices is always even.
Why this matters in Data Science
Knowledge graphs, recommendation systems, transportation networks, NLP dependency parses, neural-network computation graphs.
Mind Map
Visual structure of the conceptGRAPH G = (V, E)
├── Types
│ ├── Simple
│ ├── Multigraph
│ ├── Pseudograph (loops + multi-edges)
│ ├── Directed (digraph)
│ └── Weighted
├── Special graphs
│ ├── Complete Kₙ (|E| = nC2)
│ ├── Bipartite Kₘ,ₙ (|E| = mn)
│ ├── Regular (all deg = k)
│ └── Null (no edges)
└── Degree & Handshaking
├── deg(v)
├── Σ deg(v) = 2|E|
└── # odd-degree vertices is even
Exam Q&A
Part A (2 marks) and Part B (20 marks) style questionsPart A (2 marks each)
Q1. Define a simple graph. A graph with no self-loops and no multiple edges between the same pair of vertices.
Q2. How many edges in ? .
Q3. State the handshaking lemma. .
Q4. Define a bipartite graph. A graph whose vertex set partitions into two disjoint sets such that every edge connects to .
Part B (20 marks)
Q. Define different types of graphs with examples. State and prove the handshaking lemma. Use it to show that in any graph the number of vertices of odd degree is even.
Definitions with examples.
- Simple graph — no loops, no parallel edges. A road map between cities (one road per pair).
- Multigraph — parallel edges allowed. Multiple flights between two airports.
- Pseudograph — loops and multi-edges allowed.
- Directed graph — edges with direction. A Twitter "follow" network.
- Complete graph — every pair connected. has 6 edges.
- Bipartite graph — vertices split into two parts with edges only between. A student–course enrolment graph.
- Regular graph — every vertex same degree.
Handshaking lemma. In any undirected graph ,
Proof. Each edge contributes exactly 1 to and 1 to — i.e., 2 to the total sum. Summing over all edges gives . ∎
Corollary — odd-degree count is even. Split into odd-degree set and even-degree set . Then The second sum is even (sum of evens). is even. So is even. But it's a sum of odd numbers — that can be even only when the count is even. ∎