Construction and optimization of an ecological network based on morphological spatial pattern analysis and circuit theory