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