I have already derived vertex connections of the graph. It is a matrix with 3 columns. Column 1 contains vertex i, column 2 contains all its adjacent vertexes, column 3 contains the edge weight, so the data are already processed into something like {{1,1,0.8} {1, 3, 0.4}, {2, 3, 0.5} ...}
.
Yet I do not know how to incorporate this into igraph in R. Seems to me all presented igraph work are initiated from matrix containing original raw data.
Read in ?"igraph-package"
under the section Creating graphs, and you will find the relevant information. In your case, using graph.data.frame
is sufficient.
d <- data.frame(from=c(1, 1, 2), to=c(1, 3, 3), weight=c(0.8, 0.4, 0.5))
graph.data.frame(d)