Вопрос

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