Exercise 1'1: Adjacency matrix - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

Exercise 1'1: Adjacency matrix

Description:

Exercise 1.1: Adjacency matrix. Reciprocity: one possible definition: R = (# of vertex pairs with links both ways) / (# of linked vertex pairs) ... – PowerPoint PPT presentation

Number of Views:90
Avg rating:3.0/5.0
Slides: 5
Provided by: lce2
Category:

less

Transcript and Presenter's Notes

Title: Exercise 1'1: Adjacency matrix


1
Exercise 1.1 Adjacency matrix
gtgt load classnet_cleaned.txt gtgt
size(classnet_cleaned) ans 32 11 gtgt
Azeros(32,32) gtgt for i132, for j211, if
classnet_cleaned(i,j)gt0, A(i,classnet_cleaned(i,j)
)1 end end end gtgt directed_edgessum(sum(A))
directed_edges 133 gtgt AAA ifind(Agt0)
A(i)1 lt-- all non-zero elements to 1 gtgt
undirected_edgessum(sum(A))/2 lt-- each edge
appears twice undirected_edges 82
2
Exercise 1.1 Adjacency matrix
  • Reciprocity
  • one possible definition
  • R ( of vertex pairs with links both ways) /
    ( of linked vertex pairs)
  • (ED EU)/EU
  • ED/EU-1
  • (ED number of edges in the directed network,
    EUnumber of links in the undirected network
    where aij1 if i knows j, j knows i or both.)
  • In this example network, R 0.6220

3
Exercise 1.2 Clustering coeff
gtgt ksum(A,2) the degree of each vertex gtgt
t0.5diag(AAA) gtgt c0 N0 gtgt for
i1length(k), if (k(i)gt1), NN1
cc2t(i)/(k(i)(k(i)-1)) end end gtgt
clusteringc/N clustering 0.4948
4
Exercise 1.3 Visualization
Write a Comment
User Comments (0)
About PowerShow.com