Mercurial > hg > camir-aes2014
comparison core/magnatagatune/macro_validate_stober_randomsets.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 | |
2 nruns = 50; | |
3 weights = zeros(674, nruns); | |
4 for i = 1:50; | |
5 Gstob = ClipSimGraphStober(); | |
6 Gstob.random_all_constraints_graph; | |
7 G = ClipSimGraphMulti(Gstob.to_DiGraph()); | |
8 | |
9 % --- | |
10 % derive similarity information: this | |
11 % returns the weights of edges meaning sim(a,b) > sim(a,c) | |
12 % --- | |
13 [weights(:,i), a, b, c] = G.similarities(); | |
14 end | |
15 | |
16 % --- | |
17 % lets see if the siilarity data is the same | |
18 % it is NOT | |
19 % --- | |
20 diff = sum(sum(abs(diff(weights)))) | |
21 | |
22 % --- | |
23 % ok, my theory is that | |
24 % a. all the three-edge components are erased one edge. | |
25 % b. if not all, then the ones with two edges | |
26 % being directed at the same node. | |
27 % --- | |
28 | |
29 % --- | |
30 % have to convert, as for some reason | |
31 % this does not work yet on multigraphs | |
32 % --- | |
33 Gdi = DiGraph(G); | |
34 [Gs, s, id] = Gdi.connected_components(); | |
35 | |
36 for i = 1:numel(Gs) | |
37 edges(i) = Gs(i).num_edges(); | |
38 end | |
39 | |
40 % only 2-edge graphs | |
41 max(edges) | |
42 | |
43 % --- | |
44 % test if graphs are subgraphs of 860 full ne | |
45 % --- | |
46 Gm = ClipSimGraphMulti(comparison, comparison_ids); | |
47 Gm.remove_cycles_lenght2; | |
48 | |
49 Gm.isSubgraph(G) | |
50 |