Lecture 4 - Matrix Representation - Students
Lecture 4 - Matrix Representation - Students
Matrix
Representation
Lecturer: Dr. Reem Essameldin Ebrahim
Relationship Matrix
Adjacency Matrix
a b, c, d
b
b a, d d
c a, d
d a, b, c c
Simple Example a
Initial Terminal
Vertex Vertices
b
a c
d
b a
c c
d c, b, a
A relationship matrix thus captures the relationship between two cases. In the
above Figure, the relationship between Case 1 and Case 2 is Value 4, and the
relationship between Case 2 and Case 1 is Value 2. Wait, would that mean
Value 2 and 4 are the same? The answer is maybe. Depends on what type of
relationship is being captured.
We describe the size of the matrix by the number of rows
by the number of columns. 𝒏 is used to represent the
number of rows and m is the number of columns. Thus,
the above table is described as a 3x3 graph.
Note that: It’s not sociologically meaningful for A to have a relationship with itself in
most cases. For example, asking “Is A friends with A?” does not make much sense, but
there are rare cases when it does, such as when A is a group of people and not an
individual, and the relationship under examination might occur both within and
between groups. These are called reflexive-ties or loops.
Copyright © Dr. Reem Essameldin 2023-2024
Building Adjacency Matrix
If we want to build an adjacency matrix of a network, we simply list all the actors
in the rows and columns, and ask if the two share a relationship in order to fill in
the values.
Illustrating Example 1
The edge list for the given The adjacent list for the given
graph is: graph is:
(2, 3)
(2, 4)
(3, 2) 1:
(3, 4) 2: 3, 4
(4, 5) 3: 2, 4
(5, 1) 4: 5
(5, 2) 5: 1, 2
Copyright © Dr. Reem Essameldin 2023-2024
Test Yourself
For the given directed graph, find the corresponding asymmetric adjacency matrix.
Solution:
Solution:
Note that: Only matrices with the same Note that: Matrix multiplication is not
dimension nxm are capable of being commutative in the same way normal
summed together. Subtraction of two multiplication is. Multiplying two
matrices works in the same way as matrices together, in different orders,
addition. Copyright © Dr. Reem Essameldin 2023-2024
will not give the same results.