Fiveable

📊Graph Theory Unit 3 Review

QR code for Graph Theory practice questions

3.1 Adjacency matrices and incidence matrices

3.1 Adjacency matrices and incidence matrices

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
📊Graph Theory
Unit & Topic Study Guides

Matrices offer powerful ways to represent graphs mathematically. Adjacency matrices use a square format to show connections between vertices, while incidence matrices use a rectangular format to explicitly represent edges.

These matrix representations have different strengths. Adjacency matrices are great for dense graphs and quick edge queries, while incidence matrices work well for sparse graphs and maintaining explicit edge information.

Graph Representation Matrices

Definition of adjacency matrices

  • Square matrix represents graph structure with rows and columns corresponding to vertices
  • Entries indicate presence or absence of edges between vertex pairs
  • Symmetric matrix for simple undirected graphs with diagonal entries typically 0
  • May not be symmetric for directed graphs, entry (i,j)(i,j) represents edge from vertex ii to jj
  • Matrix entries interpret edge relationships (0: no edge, 1: edge exists, other values: edge weights)
Definition of adjacency matrices, Adjacency matrix - Wikipedia

Construction of adjacency matrices

  • Undirected graphs fill matrix symmetrically Aij=Aji=1A_{ij} = A_{ji} = 1 for existing edges
  • Directed graphs set Aij=1A_{ij} = 1 for edges from ii to jj, AjiA_{ji} may differ
  • Weighted graphs replace 1s with edge weights, 0 still indicates no edge
  • Self-loops represented by non-zero diagonal entries
  • Multiple edges summed in edge counts or weights
Definition of adjacency matrices, CS 360: Lecture 15: Graph Theory

Incidence matrices vs adjacency matrices

  • Incidence matrix: rectangular, rows for vertices, columns for edges
  • Undirected graphs: 1 if vertex incident to edge, 0 otherwise
  • Directed graphs: -1 for tail, 1 for head, 0 for non-incident
  • Both represent graph structure, incidence matrices show explicit edge info
  • Adjacency matrices focus on vertex connections

Conversion between matrix representations

  • Adjacency to incidence: create column for each non-zero adjacency entry
  • Incidence to adjacency: multiply incidence matrix by transpose A=MMTA = MM^T
  • Conversion may lose multiple edge information
  • Directed graph conversion requires additional steps

Space complexity of matrix storage

  • Adjacency matrix: O(V2)O(|V|^2) space, efficient for dense graphs
  • Incidence matrix: O(VE)O(|V||E|) space, better for sparse graphs
  • Adjacency matrices suit graphs with E|E| close to V2|V|^2
  • Incidence matrices preferred when E|E| much less than V2|V|^2
  • Adjacency matrices allow faster edge queries
  • Incidence matrices provide explicit edge representation
Pep mascot
Upgrade your Fiveable account to print any study guide

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Click below to go to billing portal → update your plan → choose Yearly → and select "Fiveable Share Plan". Only pay the difference

Plan is open to all students, teachers, parents, etc
Pep mascot
Upgrade your Fiveable account to export vocabulary

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Plan is open to all students, teachers, parents, etc
report an error
description

screenshots help us find and fix the issue faster (optional)

add screenshot

2,589 studying →