archivos = ['testdosestrellas.txt','mathworldgrafo.txt', 'instagramfamososgrafo.txt',…
- User
archivos = ['test_dosestrellas.txt','mathworld_grafo.txt', 'instagram_famosos_grafo.txt', 'test_aleatorio.txt'] #'test_30_segundos.txt'
resultados = []
lista_nodos = [10, 50, 100, 200, 500] # Número de nodos probabilidades_aristas = [0.1, 0.3, 0.5, 0.7, 0.9] # Probabilidad de enlaces
for num_nodos in lista_nodos: for prob_arista in probabilidades_aristas: W = generar_grafo_aleatorio(num_nodos, prob_arista) num_aristas = np.sum(W) # Total de aristas inicio_tiempo, fin_tiempo = calcularRanking(W, p=0.85) resultados.append({ 'nodos': num_nodos, 'aristas': num_aristas, 'tiempo': fin_tiempo - inicio_tiempo, 'nodos_x_aristas': num_nodos * num_aristas })
nodos = [res['nodos'] for res in resultados] tiempos = [res['tiempo'] for res in resultados] aristas = [res['aristas'] for res in resultados] nodos_x_aristas = [res['nodos_x_aristas'] for res in resultados]
Hacerlo sin grafo aleatoreo. Los grafos son estos
archivos = ['test_dosestrellas.txt','mathworld_grafo.txt', 'instagram_famosos_grafo.txt', 'test_aleatorio.txt'] #'test_30_segundos.txt'
- Assistant