- 1 Introduction
- 2 Graphs
- 2.1 Social Network Analysis: From Relationships to Graphs
- 2.2 The Building Blocks of Graphs: Edges and Nodes
- 2.3 Symmetric Relations and Undirected Graphs
- 2.4 Asymmetric Relations and Directed Graphs
- 2.5 Anti-Symmetric Ties and Tree Graphs
- 2.6 Order and Size
- 2.7 Average Degree
- 2.8 Degree Distributions
- 2.9 Density
- 2.10 Ego-Centric Networks
- 2.11 Weighted Ties as a Measure of Strength
- 2.12 Di-Graphs
- 2.13 Collecting Network Data
- 2.14 Practice Problems

- 3 Matrices
- 4 Centrality and Composition
- 5 Subgraphs
- 6 Where Do Networks Come From?
- 7 Social Capital: Network Structure and Social Outcomes
- 8 Whole Network
- 9 Diffusion

While a matrix is a mathematical representation of the network, taking the matrix and performing mathematical operations on the matrix can actually unveil patterns or features about the social world that we are trying to understand through the network. While the matrices we’ve worked with so far are simple, recall that in reality networks can be as complicated as the social world they represent. Facebook’s friendship networks, the connections between servers on the World Wide Web, and airline transportation networks have millions of nodes and edges. It’s important to understand some of the fundamentals of how to manipulate a matrix if we were to ever look at networks beyond many of the simple examples in this book.

Adding two matrices together is a relatively straightforward matter. By taking two matrices of the same dimension *n*X*m*, add up each corresponding cell *i,j* in the two matrices, and return the result into the same cell *i,j* in a new matrix size *n*x*m*.

\[
\begin{equation}
\begin{bmatrix} 4 & 2 & 6\\ 3 & -1 & 3\\ \end{bmatrix}
+\begin{bmatrix} 5 & 3 & 7\\ 7 & 3 & 4\\ \end{bmatrix}
=\begin{bmatrix} 9 & 8 & 13\\ 10 & 2 & 7\\ \end{bmatrix}
\end{equation}
\]
In the above example, cell *1,1* in the first matrix is 4, while in the second matrix the value of cell *1,1* is 5. Adding them together, 9 is returned and placed in cell *1,1* in the resulting new matrix. Similarly, cell *2,3* in the first matrix is 3 and 4 in the second matrix. Cell *2,3* in the summed matrix is thus 7.

Note that we are unable to add together matrices of different dimensions. Only matrices with the same dimenstion *n*x*m* are capable of being summed together, as would become easily apparent if you tried. Subtraction of two matrices works in the same way as addition.

Scalar multiplication is essentially the type of multiplication you are familiar with. Taking a single *scalar*, one can shape the original matrix into an essentially larger or smaller version of itself, the scale changing based on the size of the scalar.

\[
\begin{equation}
3
\begin{bmatrix} 5 & 6 & 3\\ 3 & 2 & 4\\ \end{bmatrix}
= \begin{bmatrix} 15 & 18 & 9\\ 9 & 6 & 12\\ \end{bmatrix}
\end{equation}
\]
In the example above, one simply multiplies each cell by the scalar term, in this case 3. Thus, the resulting cell *1,1* is simply the scalar multiplied by cell *1,1* in the original matrix. In this case, 3x5 returns 15, which becomes cell 1,1 of the resulting matrix. This is similarly done for each cell, such that the final cell *2,3* multipled by 3, returns 12, which then is the cell *2,3* in the resulting matrix.

Multiplying matrices is a type of multiplication that you are likely unfamiliar with unless you’ve studied some linear alegebra. One thing that will help in learning matrix multiplication is that you should not rely on your prior understanding of multiplication to a large degree.

When we multiply two matrices together, we are fundamentally multipling along rows in the first matrix, and columns in the second matrix. Matrix multiplication is not commutative in the same way normal multiplication is. Multiplying two matrices together, in different orders, will not give the same results.

\[ \begin{equation} {[n_1*m_1][n_2*m_2]} \end{equation} \]

\[ \begin{equation} \begin{bmatrix} 5 & 6 & 3\\ 3 & 2 & 2\\ \end{bmatrix} \begin{bmatrix} 5 & 6 \\ 5 & 6 \\ 5 & 6\\ \end{bmatrix} = \begin{bmatrix} 70 & 88 \\ 35 & 42\\ \end{bmatrix} \end{equation} \]

Left to Right Right Down