A graph is a set of vertices (nodes) together with a set of edges joining pairs of them. Almost any relation can be modelled as one — the skill is noticing when a problem is a graph problem.

  • Order: · Size:
  • Degree — number of incident edges; split into in-degree and out-degree when directed.

Edges may be undirected or directed, weighted or unweighted.


Taxonomy

CategoryTypeDefinition
DirectionUndirected implies
Directed (digraph)every edge is one-way
WeightsUnweightedevery edge costs 1
Weightedeach edge carries a cost, length or capacity
Edge rulesSimpleno self-loops, no parallel edges
Multigraphparallel edges allowed
Pseudographself-loops and parallel edges allowed
ConnectivityConnectedevery pair has a path between them
Disconnectedsome pair has none
Componenta maximal connected subgraph
StructureCompleteevery pair joined by exactly one edge
Regularevery vertex has the same degree
Bipartitevertices split into two sets, every edge crosses
CyclesCyclic / Acycliccontains a cycle, or does not
Treeconnected, undirected, acyclic
Forestacyclic, possibly disconnected
RootingOut-tree (arborescence)rooted, all edges point away from the root
In-tree (anti-arborescence)rooted, all edges point toward the root

Special named graphs

  1. DAG — directed, no directed cycle. A topological ordering exists. Every finite DAG has at least one source and one sink.
  2. Complete bipartite — every vertex of one side joined to every vertex of the other; edges.
  3. Path graph — a single simple path; two vertices of degree 1, the rest degree 2.
  4. Star — one centre of degree , all others leaves.
  5. Wheel — a cycle plus a centre adjacent to every cycle vertex.
  6. Hypercube — vertices are -bit strings, adjacent when they differ in one bit. vertices, edges, -regular.
  7. Tournament — an orientation of a complete graph; exactly one directed edge per pair. A transitive tournament is a DAG.
  8. Complement — same vertices, adjacency inverted.
  9. Line graph — one vertex per edge of ; adjacent when the edges share an endpoint.
  10. Caterpillar — a tree that becomes a path once all leaves are removed.
  11. Chordal — every cycle of length has a chord. Includes trees and complete graphs.
  12. Planar — drawable with no crossings; and .
  13. Eulerian — has a closed walk using every edge once; connected with all degrees even. See Eulerian Paths.
  14. Semi-Eulerian — has an Eulerian path; exactly two odd-degree vertices.
  15. Hamiltonian — has a cycle visiting every vertex once. No usable characterisation is known — deciding it is NP-complete.
  16. Semi-Hamiltonian — has a Hamiltonian path but perhaps no cycle.

Terminology

TermMeaning
Adjacent verticesjoined by an edge
Incident edgean edge touching a given vertex
Patha sequence of vertices with consecutive ones adjacent
Path lengthnumber of edges in the path
Simple pathno repeated vertex
Cyclea path returning to its start with no repeated interior vertex
Leaf / pendantdegree 1
Isolated vertexdegree 0
Bridge (cut edge)removing it increases the component count
Articulation point (cut vertex)removing it increases the component count
Subgrapha subset of vertices and edges
Spanning subgraphcontains all vertices
Spanning treea spanning subgraph that is a tree

Theorems worth memorising

ResultStatement
Handshake lemma — the degree sum is always even, so the number of odd-degree vertices is even
Bipartite characterisation is bipartite iff it has no odd cycle
Tree characterisationconnected and exactly edges (any two of: connected, acyclic, edges, implies the third)
Forest edge counta forest with components has edges
Complete graph edges
Max edges, simple undirected
Max edges, simple directed
Planar edge bound for ; if triangle-free
Euler’s formula for a connected planar graph

See also: Representations · Graph Theory