| 588 | return connected_graph |
| 589 | |
| 590 | def GetSubset(self,mmap,x,y): |
| 591 | mmap[x][y] = 0 |
| 592 | row = mmap[x] |
| 593 | col = mmap[:,y] |
| 594 | result = [] |
| 595 | if np.all(row==0) and np.all(col==0): |
| 596 | return result |
| 597 | for i,v in enumerate(row): |
| 598 | if v == 1 : |
| 599 | result.append(i + mmap.shape[0]) |
| 600 | result += self.GetSubset(mmap,x,i) |
| 601 | for i,v in enumerate(col): |
| 602 | if v == 1: |
| 603 | result.append(i) |
| 604 | result += self.GetSubset(mmap,i,y) |
| 605 | |
| 606 | return result |
| 607 | |
| 608 | def MergeGraph(self,graph_cache,graph_list): |
| 609 | connection_map = np.zeros((len(graph_cache), len(graph_list)), dtype=int) |