Counts the number of edges in an adjacency matrix.
nedges(amat)
amat
An adjacency matrix
A numeric (non-negative integer).