본문 바로가기

데이터마이닝

[데이터마이닝] 5.링크분석(Link analysis) 5.5절 연습문제(Exercise 5.5)

Exercise 5.5.1 : Compute the hubbiness and authority of each of the nodes in our original Web graph of Fig. 5.1.

 

n = 4
sqrt(n)
a = c(1/2,1/2,1/2,1/2)
h = c(1/2,1/2,1/2,1/2)
A = matrix(c(0,1,1,1,
             1,0,0,1,
             1,0,0,0,
             0,1,1,0), nrow = 4)

h = A%*%a
h = h/max(h)
a = t(A)%*%h
a = a/max(a)

pre_h =0
pre_a =0
while(pre_h != h || pre_a != a){
  pre_h = h
  h = A%*%a
  h = h/max(h)
  pre_a = a
  a = t(A)%*%h
  a = a/max(a)
}
a
h


! Exercise 5.5.2 : Suppose our graph is a chain of n nodes, as was suggested by Fig. 5.9. Compute the hubs and authorities vectors, as a function of n.

 

h = transpose(1,1,1,1,........1)

a = (1,1/2,1/2,1/2,1/2,1/2........,1/2)