r-reachable
introduction
Definition 1(r-reachable~set): For any given r ∈ N r\in\mathbb{N} r∈N, a subset of nodes S ⊂ N S\subset N S⊂N is said to be r-reachable if there exists a node v i ∈ V v_i\in\mathcal{V} vi∈V such that ∥ N i \ S ∥ ≤ r \|\mathcal{N}_i\backslash S\|\le r ∥Ni\S∥≤r. r r r-reachable set is a tool to measure the connectivity among the graph, the bigger r r r is, the slighter one node be influenced by one of its neighbor. For example, a complete connected graph with m m m nodes has m m m-reachable set. Hence, the influence of a regular nodes receiving adversary message by a malicious node drops to minimize.
code(Matlab)
function [result] = r_reachable( graph, subset)
temp = 0;
len = length(subset);
gsize = size(graph, 1);
result = 0;
for i = 1:len
for j = 1:gsize
if(subset(i)~=j && ~ismember(j,subset) && graph(subset(i),j)~=0)
temp = temp+1;
end
continue
end
if result < temp
result = temp;
end
temp = 0;
end
end
r-robust
introduction
Definition 2(r-robust~graph): For r ∈ N r\in\mathbb{N} r∈N, a graph G G G is said to be r r r-robust if for all pairs of disjoint nonempty subsets S 1 , S 2 ⊂ V S_1,S_2\subset\mathcal{V} S1,S2⊂V, at least one of S 1 S_1 S1 or S 2 S_2 S2 is r r r-reachable. The usage of r r r-robust graph is similar to r r r-reachable set. The distinguish between is that r r r -reachable represents local connectivity while r r r-robust represents global connectivity of a graph.Codes is given in index, significantly, it’s really complex to judge a graph is a r-robust with some r. In my opinion, it’s not a good index to measure a rather huge network. For example, we consider a network with 8 nodes, we need to split subset from 8 nodes totally 162 times.( C 8 1 + C 8 2 + C 8 3 + C 8 4 = 162 C_8^1+C_8^2+C_8^3+C_8^4=162 C81+C82+C83+C84=162)
code(Matlab)
function [result] = r_robust( graph )
gsize = size(graph, 1);
temp1 = 0;
temp2 = 0;
result = gsize;
for i = 1:floor(gsize/2)
combine = nchoosek([1:gsize], i);
for j = 1:size(combine, 1)
temp1 = r_reachable(graph, combine(j,:));
corresp = [];
for k = 1:gsize
if(~ismember(k, combine(j,:)))
corresp(end+1) = k;
end
end
temp2 = r_reachable(graph, corresp);
if(temp1 > temp2)
temp2 = temp1;
end
if(temp2 < result)
result = temp2;
end
end
end
end