A graph consists of vertices (nodes) connected by edges. The degree of a vertex is the number of edges meeting it.
Handshaking lemma
\( \sum deg(v) = 2 \times (number of edges) \)
The sum of all vertex degrees equals twice the number of edges
▶
Key terms:Simple graph = no loops or multiple edges. Connected = path between every pair of vertices. \( K_n \) (complete graph) = every vertex connected to every other.
2
Adjacency Matrices & Walks
The adjacency matrixA is an \( n \times n \) matrix where entry \( a_{ij} \) = number of edges between vertex \( i \) and vertex \( j \).
Number of walks
\( The entry (i, j) of A \)\( k \) gives the number of walks of length \( k \) from vertex \( i \) to vertex \( j \).
Worked Example
Given adjacency matrix A, find the number of walks of length 3 from vertex 1 to vertex 2.
Calculate A3 (use GDC for matrix multiplication)
Read entry (1, 2) of A3
Answer: the value in row 1, column 2 of A3
GDC: Matrix Powers
TI-84 Plus CE
Enter adjacency matrix in [A]: [2ND][MATRIX] → Edit
Calculate: [A]^3 [ENTER] → read entry (1,2)
TI-Nspire CX II
Define: a := [[0,1,1][1,0,1][1,1,0]]
Calculate: a^3 → read entry (1,2)
Casio fx-CG50
Enter matrix in Mat A: [MENU] → Run-Matrix
Calculate: Mat A ^ 3 [EXE] → read entry (1,2)
3
Euler Trails & Circuits
An Euler trail uses every edge exactly once. An Euler circuit is an Euler trail that starts and ends at the same vertex.
Euler circuit exists if:
Every vertex has even degree
(and graph is connected)
Euler trail exists if:
Exactly 2 vertices have odd degree
Trail starts/ends at the odd-degree vertices
✗
Common error: Confusing Euler (every \( edge \) once) with Hamilton (every \( vertex \) once). Remember: Euler = Edges.
4
Hamiltonian Paths & Cycles
A Hamiltonian path visits every vertex exactly once. A Hamiltonian cycle visits every vertex exactly once and returns to the start.
▶
No simple test: Unlike Euler, there is no quick rule to determine if a Hamiltonian path/cycle exists. You must search by trial. The IB only tests small graphs where this is feasible.
Common error: The nearest neighbour does NOT guarantee the optimal route. It is a greedy heuristic. Starting from different vertices may give different (better or worse) results.
7
Chinese Postman Problem
Find the shortest route that traverses every edge at least once and returns to the start. (Think: a postman delivering to every street.)
Algorithm
1. Identify all vertices with odd degree 2. Find the shortest pairings of odd vertices 3. Add these “extra” edges (repeat them) to make all degrees even 4. Total distance = sum of all edges + repeated edges
▶
If all vertices have even degree: the graph already has an Euler circuit. No extra edges needed — total distance = sum of all edge weights.
✗
Common error: With 4 odd vertices (A, B, C, D), there are 3 possible pairings: {AB+CD}, {AC+BD}, {AD+BC}. You must check all three and pick the minimum total. Do not just pick the first pairing.
A Markov chain models a system that transitions between states with fixed probabilities. The transition matrixT has columns that sum to 1.
State after \( n \) steps
s\( n \) = T\( n \)s0
s0 = initial state vector (column), T = transition matrix
Steady state
Ts = s
The steady state s satisfies Ts = s, i.e. it is an eigenvector with eigenvalue 1. Components sum to 1.
Worked Example
A brand has two products A and B. Each month, 70% of A users stay with A, 30% switch to B. 40% of B users switch to A, 60% stay. Find the steady state.
T = [0.7 0.4 ; 0.3 0.6]. Solve Ts = s with \( s_1 + s_2 = 1 \).
Enter T in [A], initial state in [B] (as column matrix)
After \( n \) steps: [A]^n \( \times \) [B] [ENTER]
For steady state: compute [A]^100 \( \times \) [B] (converges quickly)
TI-Nspire CX II
Define: t := [[0.7,0.4][0.3,0.6]] and s := [[0.5][0.5]]
After \( n \) steps: \( t^n \times s \)
Steady state: \( t^100 \times s \) or solve the eigenvector equation
Casio fx-CG50
Enter T in Mat A, initial state in Mat B
After \( n \) steps: Mat A ^ n \( \times \) Mat B
Steady state: Mat A ^ 100 \( \times \) Mat B (or use eigenvalue method)
✗
Common error: Columns (not rows) of the transition matrix must sum to 1. If the question gives row probabilities, you may need to transpose. Check the convention used.
✗
Common error: Confusing “after 3 transitions” with “at time 3”. If s0 is the initial state, then after 3 transitions the state is T3s0 (not T2s0).
9
Exam Traps & Key Reminders
✗
Show your working. For algorithms (Kruskal, Prim, nearest neighbour), list each step clearly. The IB awards marks for the process, not just the answer.
▶
TSP bounds: Always state both upper and lower bounds. The optimal solution lies between them. If they are equal, you have found the optimal route.
▶
Quick checks: A tree with \( n \) vertices has exactly \( n - 1 \) edges. A complete graph K\( n \) has \( n(n-1)/2 \) edges. There is always an even number of odd-degree vertices.
▶
Formula booklet: The adjacency matrix, Euler trail/circuit conditions, and Markov chain formula are given. The algorithms (Kruskal, Prim, nearest neighbour, Chinese postman) are NOT in the booklet — learn the steps.
This website uses essential cookies for authentication and security. We respect your privacy and comply with GDPR.
By continuing, you accept our Privacy Policy.
Cookie details
Cookie Information
Essential Cookies
JMaths uses only essential cookies required for the platform to function properly:
Session Cookies
Keep you logged in while using the platform. Deleted when you close your browser.
CSRF Protection
Prevent cross-site request forgery attacks for your security.
Performance Cache
Help load pages faster by storing temporary data.
Privacy-Friendly Analytics
Plausible Analytics
We use Plausible, a privacy-first analytics tool that doesn't use cookies and doesn't collect any personal information. It only tracks anonymous page visits to help improve the platform.
Privacy First: Our analytics are fully GDPR, COPPA, and FERPA compliant. No personal data is collected, and no cookies are used for tracking. We do not use advertising or third-party tracking cookies.
Managing Cookies
You can control cookies through your browser settings, but disabling essential cookies
may prevent the platform from working correctly. For educational use, we recommend
keeping these essential cookies enabled.