You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Matrices

We can record who is connected to whom on a given social relation via an adjacency matrix. The adjacency matrix is a square, 1-mode matrix like this:

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1e1160d5-cb38-45a9-b28e-de754d87635d"><ac:plain-text-body><![CDATA[

 

A

B

C

D

E

F

G

[http://wiki.apache.org/hama-data/attachments/BigTableForGmail/attachments/graph.jpg]

]]></ac:plain-text-body></ac:structured-macro>

A

 

1

0

1

0

0

1

B

1

 

1

0

1

0

0

C

1

1

 

1

1

0

0

D

1

1

1

 

0

0

0

E

0

0

0

1

 

1

0

F

0

0

0

0

1

 

0

G

1

1

0

0

0

0

 

If the matrix as a whole is called X, then the contents of any given cell are denoted xij. For example, in the matrix above, xij = 1, because A likes B. Note that this matrix is not quite symmetric (xij not always equal to xji).

Anything we can represent as a graph, we can also represent as a matrix. For example, if it is a valued graph, then the matrix contains the values instead of 0s and 1s.

By convention, we normally record the data so that the row person "does it to" the column person. For example, if the relation is "gives advice to", then xij = 1 means that person i gives advice to person j, rather than the other way around. However, if the data not entered that way and we wish it to be so, we can simply transpose the matrix. The transpose of a matrix X is denoted X'. The transpose simply interchanges the rows with the columns.

  • No labels