01 / 20

Network
Representations

Learn to model real-world networks as graphs, translate between visual diagrams and adjacency matrices, and interpret connectivity at a glance.

Finite Mathematics

What is a Graph?

In finite mathematics, a graph is a structure made of two sets: a set of vertices (also called nodes) and a set of edges (connections between vertices). We write \( G = (V, E) \).

A B C D E edge edge

Real-World Networks as Graphs

Graphs model countless real situations. Vertices represent entities and edges represent relationships between them.

Social Networks
People are vertices; friendships are edges
Road Maps
Intersections are vertices; roads are edges
Computer Networks
Devices are vertices; cables or links are edges

Key Vocabulary

1
Vertex (Node): A point in the graph representing an object.
2
Edge: A connection between two vertices. Written as \( \{u, v\} \).
3
Degree: The number of edges touching a vertex. Denoted \( \deg(v) \).
4
Adjacent: Two vertices are adjacent if an edge connects them.
5
Adjacency Matrix: A square matrix \( A \) where \( a_{ij} = 1 \) if vertices \( i \) and \( j \) are connected.

The Adjacency Matrix

For a graph with \( n \) vertices, the adjacency matrix is an \( n \times n \) matrix \( A \) defined by:

Symmetric
For undirected graphs: \( a_{ij} = a_{ji} \)
Diagonal
No self-loops means \( a_{ii} = 0 \)
Row Sums
Sum of row \( i \) equals \( \deg(v_i) \)

The Handshake Theorem

Every edge contributes exactly 1 to each endpoint's degree, so the total degree across all vertices is always twice the number of edges.

1 2 3 4
\(\deg(1)=3\)
\(\deg(2)=2\)
\(\deg(3)=2\)
\(\deg(4)=3\)
\(\sum\deg(v) = 3+2+2+3 = 10\)
\(2|E| = 2 \times 5 = 10\)

Directed vs Undirected Graphs

Undirected A B C Directed (Digraph) A B C
Undirected Directed
Edge notation \( \{u,v\} \) \( (u,v) \)
Matrix symmetry \( A = A^T \) \( A \neq A^T \) generally
Example Friendships Web links, one-way streets

How to Build an Adjacency Matrix

1
Label the vertices with numbers \( 1, 2, \ldots, n \).
2
Create an \( n \times n \) grid of zeros.
3
For each edge \( \{i, j\} \), set \( a_{ij} = 1 \) and \( a_{ji} = 1 \).
4
Verify symmetry: the matrix should mirror across the main diagonal.
5
Check row sums: each row sum should equal the degree of that vertex.

Example 1: Triangle Graph

1 2 3 → 1 2 3 1 2 3
$$ \begin{pmatrix} 0 & \color{#4ade80}1 & \color{#4ade80}1 \\ \color{#4ade80}1 & 0 & \color{#4ade80}1 \\ \color{#4ade80}1 & \color{#4ade80}1 & 0 \end{pmatrix} $$

Example 2: Four-City Road Network

A B C D diagonal road A B C D A B C D
$$ \begin{pmatrix} 0 & \color{#4ade80}1 & \color{#4ade80}1 & \color{#f87171}1 \\ \color{#4ade80}1 & 0 & 0 & \color{#4ade80}1 \\ \color{#4ade80}1 & 0 & 0 & \color{#4ade80}1 \\ \color{#f87171}1 & \color{#4ade80}1 & \color{#4ade80}1 & 0 \end{pmatrix} $$
Row sums:
3, 2, 2, 3
Total = \(10 = 2 \times 5\)

Example 3: Matrix to Graph

Given the adjacency matrix, reconstruct the graph:

1 2 3 4 1 2 3 4
$$ \begin{pmatrix} 0 & \color{#4ade80}1 & 0 & \color{#4ade80}1 \\ \color{#4ade80}1 & 0 & \color{#4ade80}1 & \color{#4ade80}1 \\ 0 & \color{#4ade80}1 & 0 & 0 \\ \color{#4ade80}1 & \color{#4ade80}1 & 0 & 0 \end{pmatrix} $$
→ 1 2 4 3
\(\deg(1)=2\)
\(\deg(2)=3\)
\(\deg(4)=2\)
\(\deg(3)=1\)

Powers of \( A \): Counting Walks

For example, \( (A^2)_{ij} \) counts the number of two-step walks from \( i \) to \( j \). This is computed by:

\( A^1 \)
Direct connections (1-step)
\( A^2 \)
2-step walks between vertices
\( A^3 \)
3-step walks between vertices

Degree and Connectivity

A graph is connected if there exists a path between every pair of vertices. Degree alone does not guarantee connectivity, but it provides important clues.

Connected A B C Disconnected P Q R S

Common Mistakes

✕ Forgetting Symmetry
Setting \( a_{ij} = 1 \) but leaving \( a_{ji} = 0 \) in an undirected graph. Always fill both entries.
✕ Non-Zero Diagonal
Placing a 1 on the main diagonal when there are no self-loops. For simple graphs: \( a_{ii} = 0 \) always.
✕ Confusing Degree with Edges
Thinking "degree 3" means 3 edges total. Degree counts edges at one vertex; total edges may differ.

Summary Table

Concept Graph View Matrix View
Vertex Dot / node Row and column
Edge \( \{i,j\} \) Line between \( i \) and \( j \) \( a_{ij} = a_{ji} = 1 \)
Degree of \( v \) Count edges at \( v \) Sum of row \( v \)
Adjacency Directly connected \( a_{ij} = 1 \)
Walk of length \( k \) \( k \)-step path \( (A^k)_{ij} \)
Connected One piece No block diagonal form

Question 1 of 5

A graph has 4 vertices and every vertex has degree 3. How many edges does the graph have?

Question 2 of 5

In an undirected graph's adjacency matrix, which property must always hold?

Question 3 of 5

Given the adjacency matrix below, what is \( \deg(v_2) \)?

Question 4 of 5

If \( (A^2)_{13} = 2 \), what does this tell us about the graph?

Question 5 of 5

A graph has 5 vertices and 4 edges. The degrees of four vertices are 2, 2, 1, 1. What is the degree of the fifth vertex?