A complete graph $K_n$ is an undirected graph with $n$ vertices where every pair of distinct vertices is connected by exactly one edge.
Complete graphs represent the worst-case scenario for many algorithms — every possible connection exists. The Travelling Salesman Problem considers complete weighted graphs.
KEY TAKEAWAY: $K_n$ has the maximum possible number of edges for $n$ vertices: $\dfrac{n(n-1)}{2}$.
A connected graph is an undirected graph in which there is a path between every pair of vertices.
| Type | Definition |
|---|---|
| Strongly connected | Every vertex can reach every other vertex following edge directions |
| Weakly connected | The underlying undirected graph (ignoring directions) is connected |
A DAG is a directed graph with no directed cycles.
Compile A → Link A
Compile B → Link A → Package
EXAM TIP: If a directed graph has a cycle, it cannot be a DAG and cannot be topologically sorted. Look for cycles when justifying whether a graph is a DAG.
A tree is a connected, undirected, acyclic graph.
A tree with one designated root vertex. Vertices are called parents/children/leaves. Used in decision trees, parse trees, and binary search trees.
A spanning tree of a connected graph $G$ includes all $n$ vertices and exactly $n-1$ edges (no cycles). The minimum spanning tree (MST) is the spanning tree with minimum total weight — found by Prim’s algorithm.
| Category | Directed? | Cycles? | All pairs connected? | Key Property |
|---|---|---|---|---|
| Complete graph | No | No | Yes | Maximum edges: $n(n-1)/2$ |
| Connected graph | No | Possible | Yes | Path between all pairs |
| DAG | Yes | No | Not required | Topological ordering exists |
| Tree | No | No | Yes | $n$ vertices, $n-1$ edges |
VCAA FOCUS: Know the formal definitions and be ready to classify a given graph into one or more categories. Properties (number of edges, connectivity, cycle-free) are frequently tested.