link2adj function

Extract links from an adjacency matrix