This is called an adjacency matrix.
The R FAQ has information on building social networks, expressed as matrices:
Building data on a social network can be easily done using the igraph package in R. [...] In order for the igraph package to recognize this table as a network, we can first convert it to a matrix. Then, if we want to calculate the statistical data related to it by graphs (among themselves, proximity, degree), we can use the matrix to create a graph object.
Frequently asked questions give some examples leading to sociogram diagrams, for example:

The igraph library igraph documented here - it can create much more complex examples - see the screenshot page and example below:

DNA
source share