| 554 | return connected_graph |
| 555 | |
| 556 | def GetSubset(self,mmap,x,y): |
| 557 | mmap[x][y] = 0 |
| 558 | row = mmap[x] |
| 559 | col = mmap[:,y] |
| 560 | result = [] |
| 561 | if np.all(row==0) and np.all(col==0): |
| 562 | return result |
| 563 | for i,v in enumerate(row): |
| 564 | if v == 1 : |
| 565 | result.append(i + mmap.shape[0]) |
| 566 | result += self.GetSubset(mmap,x,i) |
| 567 | for i,v in enumerate(col): |
| 568 | if v == 1: |
| 569 | result.append(i) |
| 570 | result += self.GetSubset(mmap,i,y) |
| 571 | |
| 572 | return result |
| 573 | |
| 574 | def MergeGraph(self,graph_cache,graph_list): |
| 575 | connection_map = np.zeros((len(graph_cache), len(graph_list)), dtype=int) |