# Importing adjacency matrix from file of 0/1 arrays

Is it possible to import adjacency matrix for graph representation, from simple text file with NxN (rows x columns) of 0s/1s:

0 1 0 0
1 0 1 1
0 1 0 0
0 1 0 0

-

## 1 Answer

This is pretty much taken from the documentation of AdjacencyGraph

data =
"0 1 0 0
1 0 1 1
0 1 0 0
0 1 0 0";
AdjacencyGraph[ImportString[data], VertexLabels -> "Name", ImagePadding -> 10]


-