igraph to calculate the internal PageRank of websites

plot graph website for SEO analysis
Graph of an ecommerce website where the nodes are webpages and the edges, links between them
Analysing websites internal linking is key to understand their architecture of information and web structure and thus their potential of Search Engine Optimization, SEO.

Graphs are made of nodes and edges. In SEO nodes are webpages and edges, links directed to them from other webpages on the graph.

library(igraph)
dat=read.csv(file.choose(),header=TRUE) # choose an edgelist in .csv file format
g=graph.data.frame(dat,directed=TRUE)
transitivity(g)

Transitivity or clustering coefficient is the probability that the adjacent vertices of a vertex are connected.

Count vertices vcount(graph)
Count edges ecount(graph)

Diameter
diameter(graph)
The diameter of a graph is the length of the longest geodesic.

Graph density
graph.density(graph)
The density of a graph is the ratio of the number of edges and the number of possible edges.

Find more about plotting directed graphs here.

Leave a Reply

Your email address will not be published. Required fields are marked *