Connected Components Test Page

This page uses the module Performance Test Module v6. In that link you can find more information about it and how to use this module.

1 from numpy import *
2 from iaOPF import *
3 
4 #Instancia um objeto de testes - BINARIO
5 objTestes_bin = PerfTest()
6 #Instancia um objeto de testes - INFINITO
7 objTestes_inf = PerfTest()

List of test values

 1 from courseIA368Q1S2012 import and_lib
 2 
 3 #Initialize test list vectors: one for binary Adj Matrix and other for Inf
 4 listT_bin = []
 5 listT_inf = []
 6 
 7 #Test 4 known graph with two connected components
 8 graph_4 = array( [[0,1,1,0,0,0,0,0,0],
 9             [1,0,0,0,0,0,0,1,0],
10             [1,0,0,1,0,0,0,1,0],
11             [0,0,1,0,0,0,0,1,0],
12             [0,0,0,0,0,1,1,0,0],
13             [0,0,0,0,1,0,1,0,1],
14             [0,0,0,0,1,1,0,0,1],
15             [0,1,1,1,0,0,0,0,0],
16             [0,0,0,0,0,1,1,0,0]], dtype=byte)
17 graph_inf = asarray(graph_4,dtype=float)
18 graph_inf[graph_4==0]=float('inf')
19 
20 listT_bin.append(['Two components', graph_4])
21 listT_inf.append(['Two components', graph_inf])
22 
23 #Random graph with 50% of edges, i. e., number of cc=graph order
24 graph_h = and_lib.randomGraph(500, phi=4./500, gseed=0)
25 graph_hinf = asarray(graph_h, dtype=float)
26 graph_hinf[graph_h==0]=float('inf')
27 
28 listT_bin.append(['500 phi=4/500', graph_h])
29 listT_inf.append(['500 phi=4/500', graph_hinf])
30 
31 #Test 5 random graph with no edges, i. e., number of cc=graph order
32 graph_5 = and_lib.randomGraph(500, phi=0.0, gseed=0)
33 graph_5inf = asarray(graph_5, dtype=float)
34 graph_5inf[graph_5==0]=float('inf')
35 listT_bin.append(['500 phi=0', graph_5])
36 listT_inf.append(['500 phi=0', graph_5inf])
37 
38 #Test 6 fully connected, one component
39 graph_6 = ones((500,500))
40 graph_6[range(500),range(500)]=0
41 graph_6inf = asarray(graph_6)
42 graph_6inf[range(500),range(500)]=float('Inf')
43 
44 listT_bin.append(['500 phi=1', graph_6])
45 listT_inf.append(['500 phi=1', graph_6inf])
46 
47 
48 #Adiciona o vetor de testes ao grafo
49 objTestes_bin.addTests(listT_bin)
50 objTestes_inf.addTests(listT_inf)

Pages to get tests from

A list of namespaces + pages to get the tests results from

 1 #List of namespaces + pages
 2 listPaginas = []
 3 listPaginas.append(['iaOPF', 'iacc_rod'])
 4 listPaginas.append(['iaOPF', 'iacc_rob'])
 5 listPaginas.append(['iaOPF', 'iacc_wes'])
 6 listPaginas.append(['iaOPF', 'iacc_fra'])
 7 listPaginas.append(['iaOPF', 'iacc_and'])
 8 listPaginas.append(['iaOPF', 'iacc_fer'])
 9 listPaginas.append(['iaOPF', 'iacc_thi'])
10 listPaginas.append(['iaOPF', 'iacc_tia'])

Tests Summary

Autor Funcao Two components   500 phi=4/500   500 phi=0   500 phi=1  
Rodrigo iacc_rod 0.522 ms 2 35.048 ms 6 24.772 ms 500 1926.199 ms 1
Roberto iacc_rob 0.263 ms 2 16.81 ms 6 11.443 ms 500 391.823 ms 1
Wesley iacc_wes 0.2 ms 2 15.216 ms 6 11.214 ms 500 65.549 ms 1
Francisco iacc_fra 0.208 ms 2 12.522 ms 6 10.193 ms 500 68.514 ms 1
Andre iacc_and 0.23 ms 2 15.809 ms 6 7.5 ms 500 15.778 ms 1
Fernanda iacc_fer 0.395 ms 2 2751.604 ms 6 2712.881 ms 500 7402.395 ms 1
Thiago iacc_thi 0.244 ms 2 14.63 ms 6 13.16 ms 500 96.397 ms 1
Tiago iacc_tia 0.857 ms 2 117.133 ms 6 47.17 ms 500 IndexError