library(RBGL)
set.seed(123)
g <- randomGraph(1:8, 1:5, 0.36, weights=FALSE)
mat.dist <- distanceMatrix(g)
##Matrices like in the paper
##1. adjacency matrix
eigenvalueBased(g,adjacencyMatrix,2)
##2. Laplacian matrix
eigenvalueBased(g,laplaceMatrix,2)
##3. Distance matrix
eigenvalueBased(g,distanceMatrix,2)
##4. Distance path Matrix
eigenvalueBased(g,distancePathMatrix,2)
##5. Augmented vertex degree matrix
eigenvalueBased(g,augmentedMatrix,2)
##6. Extended adjacency matrix
eigenvalueBased(g,extendedAdjacencyMatrix,2)
##7. Connectivity matrix
eigenvalueBased(g,vertConnectMatrix,2)
##8. Random Walk markov matrix
eigenvalueBased(g,randomWalkMatrix,2)
##9. Weighted structure function matrix IM1
eigenvalueBased(g,weightStrucFuncMatrix_lin,2)
##10. Weighted structure function matrix IM2
eigenvalueBased(g,weightStrucFuncMatrix_exp,2)
Run the code above in your browser using DataLab