g <- make_graph("zachary")
as.matrix(g, "adjacency")
as.matrix(g, "edgelist")
# use edge attribute "weight"
E(g)$weight <- rep(1:10, each=ecount(g))
as.matrix(g, "adjacency", sparse=FALSE, attr="weight")
Run the code above in your browser using DataLab