Site Search:

Graph.java with bfs connected components visual (with Dot language)



%3 0 0 1 1 0--1 0 2 2 0--2 0 1--2 0 3 3 1--3 0 2--3 0 4 4 2--4 0 3--4 0 5 5 3--5 0 4--5 0 6 6 4--6 0 5--6 0 7 7 5--7 0 6--7 0 8 8 6--8 0 15 15 16 16 15--16 1 17 17 16--17 1 19 19 19--19 2


Java output:


strict graph {
0--1[label=0, color=red];
0--2[label=0, color=red];
1--0[label=0, color=red];
1--2[label=0, color=red];
1--3[label=0, color=red];
2--0[label=0, color=red];
2--1[label=0, color=red];
2--3[label=0, color=red];
2--4[label=0, color=red];
3--1[label=0, color=red];
3--2[label=0, color=red];
3--4[label=0, color=red];
3--5[label=0, color=red];
4--2[label=0, color=red];
4--3[label=0, color=red];
4--5[label=0, color=red];
4--6[label=0, color=red];
5--3[label=0, color=red];
5--4[label=0, color=red];
5--6[label=0, color=red];
5--7[label=0, color=red];
6--4[label=0, color=red];
6--5[label=0, color=red];
6--7[label=0, color=red];
6--8[label=0, color=red];
7--5[label=0, color=red];
7--6[label=0, color=red];
8--6[label=0, color=red];
15--16[label=1, color=blue];
16--17[label=1, color=blue];
16--15[label=1, color=blue];
17--16[label=1, color=blue];
19--19[label=2, color=green];
}
number of points: 13
number of edges: 16

number of connected components: 3

No comments:

Post a Comment