-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateStable.m
More file actions
30 lines (30 loc) · 992 Bytes
/
Copy pathupdateStable.m
File metadata and controls
30 lines (30 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function [stableEnvs,nClubsStableEnvs,nStableEnvs,stableG] = ...
updateStable(stableEnvs,nClubsStableEnvs,nStableEnvs,stableG,membMap,config)
% Testing for isomorphism.
options = find(nClubsStableEnvs == sum(sum(membMap,2)));
base = cell(size(membMap,1),1);
base(:) = {'blue'};
base(config.Model.color == 2) = {'red'};
iso = false;
g_deg = sort(sum(membMap,2));
g = graph(membMap);
g.Nodes.Color = base;
for i = options
if all(g_deg == stableG{i,1})
try
% graph isomorphy test for color nodes graph
if(isisomorphic(stableG{i,2},g,'NodeVariables','Color'))
iso = true;
break
end
catch
end
end
end
if ~iso
nStableEnvs = nStableEnvs + 1;
stableEnvs{nStableEnvs} = membMap;
nClubsStableEnvs(nStableEnvs) = sum(sum(membMap,2));
stableG(nStableEnvs,1:2) = {g_deg,g};
end
end