聚类连通图的最佳方法是什么?
例1:
[[ 1 1 1 1 0 0]
[ 1 1 1 1 0 0]
[ 1 1 1 1 0 0]
[ 1 1 1 1 0 0]
[ 0 0 0 0 1 1]
[ 0 0 0 0 1 1]]
结果 :
==> [[0,1,2,3],[4,5]]
ex2
[[ 0 1 0 1 0 0]
[ 1 1 0 1 0 0]
[ 0 1 0 1 0 0]
[ 1 0 0 0 0 0]
[ 0 0 1 0 1 1]
[ 0 0 0 0 1 1]]
结果 :
==> [[0,1,3],[2,4,5]]
ex3
[[ 0 1 0 0 0 0]
[ 1 1 0 0 0 0]
[ 0 0 1 1 0 0]
[ 0 0 0 1 0 0]
[ 0 0 0 0 1 1]
[ 0 0 0 0 1 1]]
结果 :
==> [[0,1],[2,3],[4,5]]
谢谢