How can I find positive feedback loops from a directed graph?
조회 수: 5 (최근 30일)
이전 댓글 표시
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)
댓글 수: 0
답변 (1개)
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)
positive_feedback = zeros(length(cycles), 1);
for i=1:length(cycles)
positive_feadback(i, 1) = prod(G.Edges.Weight(edgecycles{i}));
end
positive_feadback
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!