How can I find positive feedback loops from a directed graph?

조회 수: 5 (최근 30일)
Mouli Sarkar
Mouli Sarkar 2021년 8월 27일
답변: Chunru 2021년 8월 27일
I have directed graphs. The weights of the edges can either +1 or -1. Now I want to find cycles which are equivalent to positive feedback loop.
There are two kinds of regulation activation and inhibition
----| denotes inhibition
→ denotes activation
If there are two nodes both having ----| links then the cycle will be positive feebback loop. Similarly for three nodes and upto maximum number of nodes. The cycle will be positive feedback if there are all → links or even number of ----| links.
If kindly some one suggest me how to find positive feedback loop from a network it will be very helpful? The result should not be isomorphic.
Thanks in advance
Here I am posting my code of the graph.
s = [1 4 2 5 2 3 4 4 6 5 5 6 7 8];
t = [2 1 3 2 4 6 5 7 5 7 8 9 8 9];
w = [1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 1];
G= digraph(s,t,w);
plot(G,'Layout','force','EdgeLabel',G.Edges.Weight)

답변 (1개)

Chunru
Chunru 2021년 8월 27일
s = [1 4 2 5 2 3 4 4 6 5 5 6 7 8];
t = [2 1 3 2 4 6 5 7 5 7 8 9 8 9];
w = [1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 1];
G= digraph(s,t,w);
plot(G,'Layout','force','EdgeLabel',G.Edges.Weight)
% find all cycles
[cycles, edgecycles] = allcycles(G)
cycles = 3×1 cell array
{[ 1 2 4]} {[2 3 6 5]} {[ 2 4 5]}
edgecycles = 3×1 cell array
{[ 1 3 5]} {[2 4 11 8]} {[ 3 6 8]}
positive_feedback = zeros(length(cycles), 1);
for i=1:length(cycles)
positive_feadback(i, 1) = prod(G.Edges.Weight(edgecycles{i}));
end
positive_feadback
positive_feadback = 3×1
-1 1 -1

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by