jianhuupenn / TESLA

Deciphering tumor ecosystems at super-resolution from spatial transcriptomics with TESLA
MIT License
38 stars 10 forks source link

using stack instead of recursion in DFS #3

Closed huboqiang closed 1 year ago

huboqiang commented 1 year ago

For file TESLA_package/TESLA/ConnectedComponents.py, when there are too many elements in adj matrix, the recursion level in DFS would be so high and would result in core.dump even sys.setrecursionlimit(adj.shape[0]) were set.

So it is suggested that using stack (from collections import deque) instead of recursion. This DFS algorithm would run well with 30,000x 30,000 adj matrix after this change.

jianhuupenn commented 1 year ago

Thank you for the suggestion, I have approved the request