I'm working on an implementation of the Tarjan algorithm in Matlab.
I use this source code to determine the strongly connected components.
This is the result I got, how can I view the result with Matlab (a figure that determines the colored strongly connected components)?
What is the appropriate command?

G=[0 0 1 1 0 0 0;
   1 0 0 0 0 0 0;
   0 0 0 0 0 1 0;
   0 0 0 0 1 0 0;
   0 0 0 0 0 0 1;
   0 0 0 1 0 0 0;
   0 0 0 0 0 1 0];

tarjan(G)

ans =

 7     5     4     6     0     0     0
 3     0     0     0     0     0     0
 1     0     0     0     0     0     0
 2     0     0     0     0     0     0
有帮助吗?

解决方案

There is already an examle using coloring, all nodes listed in the first row are colored with the first color, all nodes listed in the second row are colored with the second color etc...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top