Question

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
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top