13.07.2015 Views

Teoría de Grafos

Teoría de Grafos

Teoría de Grafos

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1 n = rows[w] 2 ci= 0 3 CLUSTERING-COEFFICIENT(w)neighbor[i]= 0 5 fori = 1 ton 6 do 0 7 forj 1 ton 4do ifW[i][j] = 1 9 thenneighbor[k]= j 10 k = k + 1 812 realedges= 0 13 forp = 0 tok − 2 14 do forq = p + 1 tok − 1 11do ifw[neighbor[p]][neighbor[q]] = 1 16 thenrealedges= realedges+ 1 17 18 15totaledges= k(k− 1)/2 20 ci+ realedges/totaledges 21 ci= ci/n 1922 returnci

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!