function [connectivity_vec, sub_minus_full] = connectivity(F) % PURPOSE: Compute the degree of weak connectivity, unilateral connectivity, % and strong connectivity of a fuzzy graph F. We also judge whether % each individual is a weekening point, neutral point, or % strengthening point. %------------------------------------------------------------------------------- % USAGE: [connectivity_vec, sub_minus_full] = connectivity(F) % where: F = (asymmetric) fuzzy graph (n x n) % F(i,j) is the dependence of variable i on variable j % all diagonal elements should be equal to 1. % [Example] F = [1.0, 0.8, 0.9; % 0.2, 1.0, 0.0; % 0.0, 0.5, 1.0]; % n = # of variables %------------------------------------------------------------------------------- % RETURNS: connectivity_vec = [connectivity_w; connectivity_u; connectivity_s] % (3 x 1) % connectivity_w = degree of weak connectivity of F % connectivity_u = degree of unilateral connectivity of F % connectivity_s = degree of strong connectivity of F % sub_minus_full = difference between connectivity of a subgraph F % and fuzzy graph F (n x 3) % sub_minus_full(i,:) is concerned with individual i. % sub_minus_full(:,1) is concerned with weak connectivity. % sub_minus_full(:,2) is concerned with unilateral connectivity. % sub_minus_full(:,3) is concerned with strong connectivity. % (e.g. If sub_minus_full(1,1) is NEGATIVE, then individual 1 % is a STRENGTHENING point in terms of weak connectivity. % If sub_minus_full(1,1) is ZERO, then individual 1 % is a NEUTRAL point in terms of weak connectivity. % If sub_minus_full(1,1) is POSITIVE, then individual 1 % is a WEAKENING point in terms of weak connectivity.) % ------------------------------------------------------------------------------- % SEE ALSO: maxminTM.m % ------------------------------------------------------------------------------- % REFERENCE: % H. Yamashita and T. Takizawa (2010). Fuzzy Theory. Tokyo: Kyoritsu % Shuppan Co., Ltd. (in Japanese). % ------------------------------------------------------------------------------ % Written by Kaiji Motegi, Faculty of Political Science and Economics, % Waseda University. % June 25, 2014. % ------------------------------------------------------------------------------ % define "transmax": % a function taking the element-wise maximum of a matrix A and its transpose function outcome = transmax(A) outcome = max(A, A'); end % max-min transition matrix of F F_hat = maxminTM(F); % max-min transition matrix of transmax of F F_transmax_hat = maxminTM(transmax(F)); % the degree of weak connectivity is equal to the smallest element of % transition matrix of transmax of F % (Note: direction does not matter when weak connectivity is concerned) connectivity_w = min(min(F_transmax_hat)); % the degree of unilateral connectivity is equal to the smallest element of % transmax of transition matrix of F % (Note: direction does matter but only unilateral relationship is required % when unilateral connectivity is concerned) connectivity_u = min(min(transmax(F_hat))); % the degree of strong connectivity is equal to the smallest element of % transition matrix of F % (Note: direction does matter and bilateral relationship is required % when strong connectivity is concerned) connectivity_s = min(min(F_hat)); % save results connectivity_vec = [connectivity_w; connectivity_u; connectivity_s]; n = size(F,1); % # of variables sub_minus_full = zeros(n, 3); for i = 1:n % work on each variable % remove individual i in order to get a subfigure F_sub = F([1:(i-1) (i+1):end], [1:(i-1) (i+1):end]); % get transition matrix of the subfigure F_sub_hat = maxminTM(F_sub); % get transition matrix of transmax of subfigure F_sub_transmax_hat = maxminTM(transmax(F_sub)); % weak connectivity of subfigure connectivity_sub_w = min(min(F_sub_transmax_hat)); % unilateral connectivity of subfigure connectivity_sub_u = min(min(transmax(F_sub_hat))); % strong connectivity of subfigure connectivity_sub_s = min(min(F_sub_hat)); % collect results connectivity_sub_vec = [connectivity_sub_w; connectivity_sub_u; connectivity_sub_s]; % difference between connectivity of subfigure and connectivity of % original figure. % If an element is NEGATIVE, then it means that connectivity has gone % down by removing individual i and hence individual i is a STRENGTHENING point. % If an element is ZERO, then it means that connectivity has not changed % by removing individual i and hence individual i is a NEUTRAL point. % If an element is POSITIVE, then it means that connectivity has gone up % by removing individual i and hence individual i is a WEAKENING point. sub_minus_full(i,:) = (connectivity_sub_vec - connectivity_vec)'; end; end