How can I find positive feedback loops from a directed graph?
3 次查看(过去 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!