One graph can support different matrices
A traffic graph asks whether flow balances. A webpage graph asks where a jump can lead. Both have vertices and directed edges, but they call for different matrix representations.
We first establish the graph-to-matrix correspondence, then use traffic and webpage transitions to see why different questions require different representations of a network [1][1] X. Yang, “ENG1005 Week 2: Traffic Flow, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W2.tex, [2][2] X. Yang, “ENG1005 Week 4: Webpage Transitions, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W4.tex. Prerequisites are matrix multiplication and linear systems.
Fix the graph’s meaning before writing its matrix
A finite directed graph consists of a vertex set and an edge set . An edge has a source and a destination. Our adjacency examples have no parallel edges between an ordered pair of vertices, although a model may include self-loops. With parallel edges, entries must count edges or sum their weights rather than remain binary.
A walk follows consecutive edges and may repeat vertices or edges; a simple path does not repeat vertices. Length counts edges traversed. A length-zero walk stays at its starting vertex, matching .
An undirected edge appears in two symmetric adjacency positions. Thus an undirected loop-free graph has a symmetric adjacency matrix with zero diagonal. In a directed graph, having both directions available does not require equal weights.
Weights may represent flow, connection strength, distance, or probability. Ordinary multiplication does not interpret these units automatically. Path distance normally adds edge lengths and shortest paths minimize over alternatives; products of edge weights from ordinary matrix multiplication are not shortest-path lengths.
Adjacency records one-step connections
Fix a vertex order and use columns for sources, rows for destinations. For an unweighted directed graph, define
This convention suits multiplication of state columns: column records destinations from . Some texts use the opposite convention, so check before calculating.
For vertices and edges ,
There is one length-two walk from to , through .
Under this convention, counts walks of length exactly from to . A walk may repeat vertices and edges; it need not be a simple path.
The case is the definition. Assuming the result for ,
Each length- walk has a unique penultimate vertex . Count its first steps from to , then its last edge to . Summing over counts every walk exactly once.
With weighted adjacency, powers instead sum the products of edge weights along walks.
Degree, weight, and probability
Under the source-column convention, column of an unweighted adjacency matrix sums to vertex ‘s outdegree, while row sums to vertex ‘s indegree. A self-loop contributes once to each.
For weighted graphs, these sums give total outgoing and incoming weight, often called strength, not necessarily edge counts. Two outgoing edges with weights give outdegree two and outgoing strength .
If weights are probabilities, outgoing weight must sum to one for each source. If weights represent traffic, columns generally need neither normalization nor equal totals. Nonnegative entries alone do not make a matrix a transition matrix.
Transposition, relabelling, and isomorphism
With the convention fixed, reverses all directed edges. The resulting graph need not be isomorphic to the original.
For a counterexample, take only . The original has a vertex of outdegree two; the reversed graph has none. Relabelling cannot change that distinction.
Relabelling uses a permutation matrix. If old coordinates become , the new matrix is
because . Rows and columns must be permuted together to preserve both endpoints of every edge. A third situation is changing the storage convention from source rows to source columns: the array is transposed, but the graph is unchanged because the interpretation also changes. These are different operations.
Relabelling the example explicitly
Change the three-vertex order from to with
The original edge now goes from vertex two to vertex one. Relabelling every endpoint gives
Connections are unchanged; their array positions change. Swapping only rows changes destination labels without making the same adjustment to sources, generally producing another graph.
Incidence records each edge’s balance
Return to the traffic network. Order rows as and columns as roads . A directed edge contributes at its source and at its destination:
Adjacency has vertices on both axes; incidence has vertices on one axis and edges on the other. The product gives internal inflow minus internal outflow at each vertex. It must equal net external outflow:
These are the equations from the systems chapter, with rows reordered and some signs reversed.
Every column has one and one , so
Consequently, the right-hand side must sum to zero. Internal roads cannot create net inflow to the region.
Why four vertices give three independent balances
If , then each edge equates the values at its endpoints. When the underlying undirected graph is connected, all vertex values must agree. Thus every row dependence is a multiple of the sum relation, and the four rows have rank three.
More generally, an incidence matrix on vertices with connected components has rank : the values of may be independently constant on each component. Connectivity here always ignores edge orientation.
Null directions describe circulations
The traffic model’s free directions are
The second adds equal flow around , cancelling at each vertex. The first also balances, but its negative components reduce flow relative to the road arrows. The nullspace therefore describes signed circulation changes, not necessarily physically admissible nonnegative traffic by themselves.
With five edges, four vertices, and a connected underlying graph, these changes have dimension , matching elimination’s two free parameters.
Webpage transitions turn weights into probabilities
Consider random jumps between three webpages, described by
Again, columns are sources and rows are destinations. Column one gives probabilities of reaching pages one, two, and three from page one. Each column is nonnegative and sums to one.
If records expected page populations after step , then
Actual counts in a finite population fluctuate under random jumps; the matrix predicts expectations. Normalizing the state to a probability distribution gives the same equation.
Column sums preserve total population:
Starting from gives after one step and after three.
A stationary distribution satisfies
For this model,
as direct multiplication verifies. This is an eigenvector for eigenvalue , but having a stationary distribution does not by itself prove convergence from every initial state. A matrix that swaps two vertices has stationary distribution , yet the state oscillates forever. Below we prove convergence for the current model directly from its particular structure.
Turning nonnegative weights into probabilities
If column of a weighted adjacency matrix has sum , normalize by source:
This models choosing an outgoing edge proportionally to its weight. It is an additional assumption: if weights are road lengths, this rule favors longer roads and may not describe the desired behavior.
An all-zero column has no specified destination and cannot be normalized by division. The model must decide what happens, such as staying at the same vertex or restarting from a specified distribution. Different choices produce different transition matrices.
Why expected populations multiply by the matrix
If page currently has people and each has probability of moving to page , its expected contribution is . Summing over source pages gives
This first conditions on current counts. If those counts are random too, taking expectation with the same fixed transition rule yields . Additivity of expectation does not require different people’s jumps to be independent; dependence affects fluctuations but does not invalidate this expectation formula.
Proving convergence for this particular matrix
Let total population be , with expected page populations . The third row gives
After one step, the third component is fixed. Substitute into the first row. For ,
Its fixed value satisfies , giving . Subtracting that value reveals
For , induction gives
The deviation tends to zero. Conservation determines the remaining component, proving convergence from every initial population distribution to .
Starting from gives and then . The first component’s deviation from shrinks from to . Starting with people per page lands exactly at stationarity after one step, a special initial condition rather than a general one-step convergence rule.
This proof uses the particular third row. General transition matrices need not simplify this way, and unit column sums alone do not imply convergence.
The same multiplication answers different questions
| Representation | Meaning of a column | What multiplication describes |
|---|---|---|
| Adjacency | Edges leaving a vertex | Connections and walks |
| Incidence | One edge’s endpoint balance | Conservation and circulations |
| Transition | Destination probabilities from a vertex | Random state evolution |
Before choosing a matrix, identify where the state lives, what each entry means, and which orientation convention applies.
Exercises
What are the probabilities of moving from page one to page two and from page two to page one? Why may they differ?
Solution
They are and . They condition on different source pages. Unit column sums do not require symmetry.
Compute . If is feasible, is feasible for every real ?
Solution
The product is zero, so all equality constraints remain satisfied. Negative may make some flows negative; physical feasibility still requires a componentwise check.
Two vertices have one edge in each direction and no self-loops. Count length-two walks and explain why they need not be simple paths.
Solution
The adjacency matrix swaps coordinates, so its square is identity. Each vertex has one two-step return walk; there are no two-step walks between distinct vertices. Returning to the start repeats a vertex, so it is not a simple path.
The three-page model has first-step state . Find its third-step state without a full matrix product.
Solution
The total is . The first component’s deviation from is multiplied by each step, giving deviation at step three. The third component remains , so conservation gives state $(597,1203,1200)^{\mathsf T}.
References
- [1] X. Yang, “ENG1005 Week 2: Traffic Flow, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W2.tex ↩
- [2] X. Yang, “ENG1005 Week 4: Webpage Transitions, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W4.tex ↩
Comments