caesar0301 / s2g

(S)hapefile to(2) (G)raph/network converter in Python
https://pypi.python.org/pypi/s2g
MIT License
24 stars 8 forks source link

Removed unneccesary allocation in gen_major_components #6

Closed lobisquit closed 5 years ago

lobisquit commented 5 years ago

In ShapeGraph.gen_major_components the allocation of neighbours in the form of integers couples is problematic, because when hundreds of thousand of nodes are considered memory is easily filled up in the process. This solution is equivalent to the previous code, but doesn't need any memory occupation.