adding a function to convert from a list of links (and weights) to a (weighted) adjacency matrix