0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 close all;
0011
0012
0013 nRmHub = 15;
0014 nRmHubCX = 10;
0015 REPEAT_TIMES = 100;
0016 REWIRE_PROB_RING = 0.3;
0017
0018
0019 xErrBarWidth = 0.015;
0020 yErrBarWidth = 0.025;
0021 FIG_SIZE = [0 0 600 650];
0022 textSize = 16;
0023 lineWidth = 3;
0024 markerSize = 10;
0025 markerScale = 1.5;
0026
0027
0028 nNode = ceNetwork.size;
0029 nInput = ceNetwork.inputNumber;
0030 nOutput = ceNetwork.outputNumber;
0031 nInter = ceNetwork.size - nInput - nOutput;
0032 nEdge = mean(sum(ceNetwork.matrix));
0033
0034 tmpRmNet = ceNetwork;
0035 rmHubHorzCE = zeros(1, nRmHub);
0036 rmHubVertCE = zeros(1, nRmHub);
0037 parCoefCE = participateCoef(tmpRmNet);
0038 rmParCoefCE = zeros(1, nRmHub);
0039
0040 tmpInOutDeg = sum(tmpRmNet.matrix, 1)' + sum(tmpRmNet.matrix, 2);
0041 [tmpSort, tmpSortIx] = sort(tmpInOutDeg, 'descend');
0042 tmpSortLabel = tmpRmNet.label(tmpSortIx);
0043 for iNode = 1:nRmHub
0044 tmpLabel = tmpSortLabel(iNode);
0045 rmIx = find(tmpRmNet.label == tmpLabel, 1);
0046 tmpRmNet = rmNode(tmpRmNet, rmIx);
0047 rmParCoefCE(iNode) = parCoefCE(tmpSortIx(iNode));
0048
0049 tmpRmNet = levelAnalysis(tmpRmNet, MAX_LEVEL);
0050 rmHubVertCE(iNode) = tmpRmNet.VertProp(3);
0051 rmHubHorzCE(iNode) = tmpRmNet.HorzProp(3);
0052 end
0053
0054
0055 tmpRmNet = cxNetwork;
0056 rmHubHorzCX = zeros(1, nRmHubCX);
0057 rmHubVertCX = zeros(1, nRmHubCX);
0058 parCoefCX = participateCoef(tmpRmNet);
0059 rmParCoefCX = zeros(1, nRmHubCX);
0060
0061 tmpInOutDeg = sum(tmpRmNet.matrix, 1)' + sum(tmpRmNet.matrix, 2);
0062 [tmpSort, tmpSortIx] = sort(tmpInOutDeg, 'descend');
0063 tmpSortLabel = tmpRmNet.label(tmpSortIx);
0064 for iNode = 1:nRmHubCX
0065 tmpLabel = tmpSortLabel(iNode);
0066 rmIx = find(tmpRmNet.label == tmpLabel, 1);
0067 tmpRmNet = rmNode(tmpRmNet, rmIx);
0068 rmParCoefCX(iNode) = parCoefCX(tmpSortIx(iNode));
0069
0070 tmpRmNet = levelAnalysis(tmpRmNet, MAX_LEVEL);
0071 rmHubVertCX(iNode) = tmpRmNet.VertProp(3);
0072 rmHubHorzCX(iNode) = tmpRmNet.HorzProp(3);
0073 end
0074
0075
0076 clear rmHubSwNet meanRmHubSwNet
0077 for iTime = 1:REPEAT_TIMES
0078 seedNumber = iTime * STRIDE_SEED_NUMBER;
0079 rmHubSwNet{iTime} = ...
0080 smallHubNetwork(nNode, REWIRE_PROB_RING, seedNumber, ...
0081 nEdge, nRmHub, 'kinless');
0082 rmHubSwNet{iTime} = setIO(rmHubSwNet{iTime}, ceNetwork.inputNumber, ...
0083 ceNetwork.outputNumber);
0084 rmHubSwNet{iTime} = levelAnalysis(rmHubSwNet{iTime}, MAX_LEVEL);
0085
0086 tmpInOutDeg = sum(rmHubSwNet{iTime}.matrix, 1)' + ...
0087 sum(rmHubSwNet{iTime}.matrix, 2);
0088 [tmpSort, tmpSortIx] = sort(tmpInOutDeg, 'descend');
0089 tmpSortLabel = rmHubSwNet{iTime}.label(tmpSortIx);
0090 rmHubSwNet{iTime}.HubList = tmpSortIx(1:nRmHub);
0091
0092
0093 rmHubSwNet{iTime}.PartpCoef = participateCoef(rmHubSwNet{iTime});
0094 tmpRmNet = rmHubSwNet{iTime};
0095 for jNode = 1:nRmHub
0096 tmpLabel = tmpSortLabel(jNode);
0097 rmIx = find(tmpRmNet.label == tmpLabel, 1);
0098 tmpRmNet = rmNode(tmpRmNet, rmIx);
0099
0100 tmpRmNet = levelAnalysis(tmpRmNet, MAX_LEVEL);
0101 rmHubSwNet{iTime}.RmHubVertProp(jNode) = tmpRmNet.VertProp(3);
0102 rmHubSwNet{iTime}.RmHubHorzProp(jNode) = tmpRmNet.HorzProp(3);
0103 end
0104 end
0105
0106 meanRmHubSwNet = meanFieldInCells(rmHubSwNet);
0107 tmpHorz = cellfun(@(x) x.HorzProp(3), rmHubSwNet);
0108 tmpVert = cellfun(@(x) x.VertProp(3), rmHubSwNet);
0109 meanRmHubSwNet.StdHorzProp = std(tmpHorz);
0110 meanRmHubSwNet.StdVertProp = std(tmpVert);
0111 for jNode = 1:nRmHub
0112 tmpVert = cellfun(@(x) x.RmHubVertProp(jNode), rmHubSwNet);
0113 tmpHorz = cellfun(@(x) x.RmHubHorzProp(jNode), rmHubSwNet);
0114 meanRmHubSwNet.StdRmHubVertProp(jNode) = std(tmpVert);
0115 meanRmHubSwNet.StdRmHubHorzProp(jNode) = std(tmpHorz);
0116 end
0117
0118
0119 figure('name', 'summary', 'outerPosition', FIG_SIZE, 'color', 'w');
0120 hold on;
0121 plot(ceNetwork.HorzProp(3), ceNetwork.VertProp(3), ...
0122 'Marker', netMarker('CE'), 'Color', netColor('CE'), ...
0123 'MarkerFaceColor', netMarkerFace('CE'), ...
0124 'MarkerSize', markerSize, 'LineWidth', lineWidth);
0125 plot(cxNetwork.HorzProp(3), cxNetwork.VertProp(3), ...
0126 'Marker', netMarker('CX'), 'Color', netColor('CX'), ...
0127 'MarkerFaceColor', netMarkerFace('CX'), ...
0128 'MarkerSize', markerSize * markerScale, 'LineWidth', lineWidth);
0129 plot(meanRandNet.HorzProp(3), meanRandNet.VertProp(3), ...
0130 'Marker', netMarker('ER'), 'Color', netColor('ER'), ...
0131 'MarkerFaceColor', netMarkerFace('ER'), ...
0132 'MarkerSize', markerSize * markerScale, 'LineWidth', lineWidth);
0133 plot(meanRegularNet.HorzProp(3), meanRegularNet.VertProp(3), ...
0134 'Marker', netMarker('RL'), 'Color', netColor('RL'), ...
0135 'MarkerFaceColor', netMarkerFace('RL'), ...
0136 'MarkerSize', markerSize, 'LineWidth', lineWidth);
0137 plot(meanRingNet.HorzProp(3), meanRingNet.VertProp(3), ...
0138 'Marker', netMarker('SW'), 'Color', netColor('SW'), ...
0139 'MarkerFaceColor', netMarkerFace('SW'), ...
0140 'MarkerSize', markerSize, 'LineWidth', lineWidth);
0141 plot(meanRmHubSwNet.HorzProp(3), meanRmHubSwNet.VertProp(3), ...
0142 'Marker', netMarker('Kinless'), 'Color', netColor('Kinless'), ...
0143 'MarkerFaceColor', netMarkerFace('Kinless'), ...
0144 'MarkerSize', markerSize, 'LineWidth', lineWidth);
0145 set(gca, 'FontSize', 18, 'lineWidth', 4, 'FontWeight', 'bold');
0146 xlabel('Horizontal propagation');
0147 ylabel('Vertical propagation');
0148 box off;
0149 hold off;
0150
0151
0152 hold on;
0153 tmpHorz = cellfun(@(x) x.HorzProp(3), randNetwork);
0154 tmpVert = cellfun(@(x) x.VertProp(3), randNetwork);
0155 hErr = ploterr(mean(tmpHorz), mean(tmpVert), std(tmpHorz), std(tmpVert), ...
0156 'abshhx', xErrBarWidth, 'abshhy', yErrBarWidth);
0157 set(hErr, 'lineWidth', 2, 'Color', netColor('ER'));
0158
0159 tmpHorz = cellfun(@(x) x.HorzProp(3), regularRingNet);
0160 tmpVert = cellfun(@(x) x.VertProp(3), regularRingNet);
0161 hErr = ploterr(mean(tmpHorz), mean(tmpVert), std(tmpHorz), std(tmpVert), ...
0162 'abshhx', xErrBarWidth, 'abshhy', yErrBarWidth);
0163 set(hErr, 'lineWidth', 2, 'Color', netColor('RL'));
0164
0165 tmpHorz = cellfun(@(x) x.HorzProp(3), smallRingNet);
0166 tmpVert = cellfun(@(x) x.VertProp(3), smallRingNet);
0167 hErr = ploterr(mean(tmpHorz), mean(tmpVert), std(tmpHorz), std(tmpVert), ...
0168 'abshhx', xErrBarWidth, 'abshhy', yErrBarWidth);
0169 set(hErr, 'lineWidth', 2, 'Color', netColor('SW'));
0170 hold off;
0171
0172
0173 hold on;
0174 plot(rmHubHorzCE, rmHubVertCE, ...
0175 'Marker', netMarker('CE'), 'Color', netColor('CE'), ...
0176 'MarkerFaceColor', netMarkerFace('CE'), ...
0177 'MarkerSize', markerSize - 2, 'LineWidth', lineWidth - 1);
0178 plot(rmHubHorzCE, rmHubVertCE, '--', 'Color', netColor('CE'), 'LineWidth', 2);
0179
0180 plot(rmHubHorzCX, rmHubVertCX, ...
0181 'Marker', netMarker('CX'), 'Color', netColor('CX'), ...
0182 'MarkerFaceColor', netMarkerFace('CX'), ...
0183 'MarkerSize', markerSize * markerScale - 2, 'LineWidth', lineWidth - 1);
0184 plot(rmHubHorzCX, rmHubVertCX, '--', 'Color', netColor('CX'), 'LineWidth', 2);
0185
0186 plot(meanRmHubSwNet.RmHubHorzProp, meanRmHubSwNet.RmHubVertProp, ...
0187 'Marker', netMarker('Kinless'), 'Color', netColor('Kinless'), ...
0188 'MarkerFaceColor', netMarkerFace('Kinless'), ...
0189 'MarkerSize', markerSize - 2, 'LineWidth', lineWidth - 1);
0190 tmpHorz = [meanRmHubSwNet.HorzProp(3), meanRmHubSwNet.RmHubHorzProp];
0191 tmpVert = [meanRmHubSwNet.VertProp(3), meanRmHubSwNet.RmHubVertProp];
0192 plot(tmpHorz, tmpVert, '--', 'lineWidth', 2, 'Color', netColor('Kinless'));
0193
0194 hErr = ploterr(meanRmHubSwNet.HorzProp(3), meanRmHubSwNet.VertProp(3), ...
0195 meanRmHubSwNet.StdHorzProp, meanRmHubSwNet.StdVertProp, ...
0196 'abshhx', xErrBarWidth, 'abshhy', yErrBarWidth);
0197 set(hErr, 'lineWidth', 2, 'Color', netColor('Kinless'));
0198
0199 hErr = ploterr(meanRmHubSwNet.RmHubHorzProp, meanRmHubSwNet.RmHubVertProp, ...
0200 meanRmHubSwNet.StdRmHubHorzProp, meanRmHubSwNet.StdRmHubVertProp, ...
0201 'abshhx', xErrBarWidth, 'abshhy', yErrBarWidth);
0202 set(hErr, 'lineWidth', 2, 'Color', netColor('Kinless'));
0203 hold off;
0204
0205
0206 text(double(ceNetwork.HorzProp(3)), double(ceNetwork.VertProp(3) + 0.02), ...
0207 ' CE', 'FontSize', textSize, 'FontWeight', 'bold');
0208 text(double(cxNetwork.HorzProp(3)), double(cxNetwork.VertProp(3)), ...
0209 ' CX', 'FontSize', textSize, 'FontWeight', 'bold');
0210 text(double(meanRandNet.HorzProp(3)), double(meanRandNet.VertProp(3)), ...
0211 ' ER', 'FontSize', textSize, 'FontWeight', 'bold');
0212 text(double(meanRegularNet.HorzProp(3)), double(meanRegularNet.VertProp(3)), ...
0213 ' RL', 'FontSize', textSize, 'FontWeight', 'bold');
0214 text(double(meanRingNet.HorzProp(3)), double(meanRingNet.VertProp(3)), ...
0215 'SW ', 'FontSize', textSize, 'FontWeight', 'bold', ...
0216 'HorizontalAlignment', 'right');
0217 text(double(meanRmHubSwNet.HorzProp(3)), double(meanRmHubSwNet.VertProp(3)), ...
0218 ' Kinless', 'FontSize', textSize, 'FontWeight', 'bold');
0219 hT = text(double(rmHubHorzCE(7)), double(rmHubVertCE(7) + 0.065), ...
0220 'removing hubs', 'FontSize', textSize - 2, 'FontWeight', 'bold', ...
0221 'HorizontalAlignment', 'center', 'VerticalAlignment', 'bottom');
0222 ext = get(hT, 'extent');
0223 annotation('arrow', [ext(1) + ext(3), ext(1) + 0.05], [ext(2) - 2.5 * ext(4), ext(2)- 2.5 * ext(4)]);
0224 hT = text(double(meanRmHubSwNet.RmHubHorzProp(9)), double(meanRmHubSwNet.RmHubVertProp(9) - 0.08), ...
0225 'removing hubs', 'FontSize', textSize - 2, 'FontWeight', 'bold', ...
0226 'HorizontalAlignment', 'center', 'VerticalAlignment', 'top');
0227 ext = get(hT, 'extent');
0228 annotation('arrow', [ext(1) + ext(3), ext(1) + 0.05], [ext(2) - 0.1, ext(2) - 0.1]);
0229 breakYaxis(2);
0230 set(gca, 'xtick', 0:0.2:1);
0231
0232
0233 figure('color', 'w', 'outerPosition', [0 0 850 600], 'name', 'C. Elegnas');
0234 hA = axes('Position',[0 0 1 1],'Visible','off');
0235 axes('Position',[.1 .15 .7 .7]);
0236 plot(1:nRmHub, rmParCoefCE, '.r', 'markerSize', 30, 'lineWidth', 2);
0237 ylim([0 1]);
0238 hold on;
0239 h = plot([0, nRmHub], [0.3, 0.3], '--k', ...
0240 [0, nRmHub], [0.75, 0.75], '--k');
0241 set(h, 'lineWidth', 2);
0242 set(gca, 'FontSize', 18, 'lineWidth', 2, 'FontWeight', 'bold');
0243 xlabel('Removed hub id');
0244 ylabel('Participation coefficient');
0245 box off;
0246 set(gcf,'CurrentAxes',hA);
0247 text(0.82, .75, 'Kinless', 'fontSize', 18, 'fontWeight', 'bold');
0248 text(0.82, .5, 'Connector', 'fontSize', 18, 'fontWeight', 'bold');
0249 text(0.82, .25, 'Provincial', 'fontSize', 18, 'fontWeight', 'bold');
0250 box off;
0251 hold off;
0252
0253
0254 figure('color', 'w', 'outerPosition', [0 0 850 600], 'name', 'Central complex');
0255 hA = axes('Position',[0 0 1 1],'Visible','off');
0256 axes('Position',[.1 .15 .7 .7]);
0257 plot(1:nRmHubCX, rmParCoefCX, '.r', 'markerSize', 30, 'lineWidth', 2);
0258 ylim([0 1]);
0259 hold on;
0260 h = plot([0, nRmHubCX], [0.3, 0.3], '--k', ...
0261 [0, nRmHubCX], [0.75, 0.75], '--k');
0262 set(h, 'lineWidth', 2);
0263 set(gca, 'FontSize', 18, 'lineWidth', 2, 'FontWeight', 'bold');
0264 xlabel('Removed hub id');
0265 ylabel('Participation coefficient');
0266 box off;
0267 set(gcf,'CurrentAxes',hA);
0268 text(0.82, .75, 'Kinless', 'fontSize', 18, 'fontWeight', 'bold');
0269 text(0.82, .5, 'Connector', 'fontSize', 18, 'fontWeight', 'bold');
0270 text(0.82, .25, 'Provincial', 'fontSize', 18, 'fontWeight', 'bold');
0271 box off;
0272 hold off;