衡量连通图连通性一些指标(r-reachable, r-robust)

r-reachable

introduction

Definition 1(r-reachable~set): For any given r ∈ N r\in\mathbb{N} rN, a subset of nodes S ⊂ N S\subset N SN is said to be r-reachable if there exists a node v i ∈ V v_i\in\mathcal{V} viV such that ∥ N i \ S ∥ ≤ r \|\mathcal{N}_i\backslash S\|\le r Ni\Sr. 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} rN, 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,S2V, 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值