Pregunta

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
¿Fue útil?

Solución

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...

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top