Created
November 6, 2012 00:53
-
-
Save billowdood/4021681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = 0 | |
j = 0 | |
suma = 0 | |
suma2 = 0 | |
grados = [] | |
while(i<33): | |
while(j<33): | |
suma += mat[i][j] | |
suma2 += mat[i][j] | |
j = j + 1 | |
grados.append(suma2) | |
suma2 = 0 | |
i = i + 1 | |
j = 0 | |
if (i==33): | |
break | |
print mat | |
float(suma) | |
densidad = suma/(33.0*32.0) | |
print "Densidad de la red: ",densidad | |
contador = 1 | |
for elemen in grados: | |
if(elemen != 0): | |
print "Para k = ",elemen,"tiene una distribucion de grado de ",(float(grados.count(elemen))/len(grados)) | |
for con in range(contador,len(grados)): | |
if(grados[con] == elemen): | |
grados[con] = 0 | |
contador+=1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment