pysal / region

A library for Spatially-Explicit Regionalization
BSD 3-Clause "New" or "Revised" License
14 stars 16 forks source link

maxp heuristic issue #31

Closed rwei5 closed 4 years ago

rwei5 commented 4 years ago

MaxPRegionsHeu requires the specification of local search strategies, which are implemented under p-regions, azp.py.

When local search strategy is set as basic tabu search (class AZPBasicTabu) (which results in best objective value based on Duque et al. 2012), it did not check whether the area move ensures that the region after the area move still reaches threshold of spatial extensive attribute.

renanxcortes commented 4 years ago

MaxPRegionsHeu requires the specification of local search strategies, which are implemented under p-regions, azp.py.

When local search strategy is set as basic tabu search (class AZPBasicTabu) (which results in best objective value based on Duque et al. 2012), it did not check whether the area move ensures that the region after the area move still reaches threshold of spatial extensive attribute.

Ok, cool, so, as far as I understood making an additional condition in the step that happens in https://github.com/pysal/region/blob/3dcf777b6a9d528145013023257ba405608261e7/region/p_regions/azp.py#L800 (i.e. assuring that the regions generated by this move would not violate the lowerbound threshold limit) before moving to Step 2 would be enough for solving this bug?

knaaptime commented 4 years ago

to be clear @rwei5, the bug is only in AZPBasicTabu, but not the other AZP subclasses (like generic AZP or AZPSimulatedAnnealing)?

renanxcortes commented 4 years ago

to be clear @rwei5, the bug is only in AZPBasicTabu, but not the other AZP subclasses (like generic AZP or AZPSimulatedAnnealing)?

I try to answer this question in this comment here: https://github.com/pysal/region/issues/32#issuecomment-519264830

renanxcortes commented 4 years ago

Fixed in https://github.com/pysal/region/pull/33.