greedy_alloc - ObjectVision/GeoDMS GitHub Wiki
Allocation functions greedy_alloc
The greedy_alloc family of functions perform land-use allocation using a greedy algorithm (simpler and faster than discrete_alloc). Unlike discrete_alloc, greedy_alloc does not use shadow price optimization and instead allocates land units directly in order of their suitability scores.
syntax
- greedy_alloc(arguments)
- greedy_alloc_16(arguments)
- greedy_alloc_sp(arguments)
- greedy_alloc_sp_16(arguments)
- greedy_alloc_np(arguments)
- greedy_alloc_np_16(arguments)
Where:
_16suffix allows up to 65535 land use types (UInt16) instead of 255 (UInt8)_spsuffix is the single-partition variant_npsuffix is the no-partition variant
definition
The greedy_alloc function allocates land units to land-use types by iteratively assigning each land unit to the type with the highest suitability that still has capacity (has not reached its maximum claim).
greedy_alloc_np (no partition)
| # | argument | description | type | value type |
|---|---|---|---|---|
| 1 | TypeNames | Land-use type names | attribute | string |
| 2 | LandUnitDomain | Domain unit for land units | unit | uint32 |
| 3 | SuitabilityMaps | Container with suitability map for each land-use type | container | int32 |
| 4 | MinClaims | Minimum land units per type | container | uint32 |
| 5 | MaxClaims | Maximum land units per type | container | uint32 |
| 6 | Threshold | Minimum suitability for allocation | parameter | int32 |
greedy_alloc_sp (single partition)
| # | argument | description | type | value type |
|---|---|---|---|---|
| 1 | TypeNames | Land-use type names | attribute | string |
| 2 | LandUnitDomain | Domain unit for land units | unit | uint32 |
| 3 | SuitabilityMaps | Container with suitability map for each land-use type | container | int32 |
| 4 | Regions | Domain for claim regions | unit | uint8/uint16 |
| 5 | RegionMap | Maps land units to regions | attribute | uint8/uint16 |
| 6 | MinClaims | Minimum land units per type per region | container | uint32 |
| 7 | MaxClaims | Maximum land units per type per region | container | uint32 |
| 8 | Threshold | Minimum suitability for allocation | parameter | int32 |
greedy_alloc (multiple partitions)
| # | argument | description | type | value type |
|---|---|---|---|---|
| 1 | TypeNames | Land-use type names | attribute | string |
| 2 | LandUnitDomain | Domain unit for land units | unit | uint32 |
| 3 | SuitabilityMaps | Container with suitability map for each land-use type | container | int32 |
| 4 | Partitionings | Maps each land-use type to a partitioning id | attribute | uint8 |
| 5 | PartitioningNames | Maps each partitioning to a name | attribute | string |
| 6 | AtomicRegions | Unit for atomic regions | unit | uint8/uint16 |
| 7 | AtomicRegionMap | Maps land units to atomic regions | attribute | uint16 |
| 8 | MinClaims | Minimum land units per type per region | container | uint32 |
| 9 | MaxClaims | Maximum land units per type per region | container | uint32 |
| 10 | Threshold | Minimum suitability for allocation | parameter | int32 |
| 11 | FeasibleSolution | Arbitrary container for possible future use | container | (empty) |
Result
Same structure as discrete_alloc:
- landuse: allocated land use type for each land unit
- statusFlag: boolean indicating feasibility
- status: text explaining the result
- shadow_prices: shadow prices per land use type
- total_allocated: count of allocated land units per type
- bid_price: resulting bid prices
performance
The greedy algorithm has complexity O(n × k × log k) where:
- n = number of land units
- k = number of land-use types
This is faster than the discrete_alloc function which uses Hitchcock transportation problem optimization with complexity O(n × k) but with higher constant factors due to shadow price adjustment iterations.
Use greedy_alloc when:
- Speed is more important than optimality
- Claims are not heavily constrained
- Shadow prices are not needed for economic interpretation
Use discrete_alloc when:
- Optimal allocation is required
- Shadow prices are important for analysis
- Claims may conflict and require balanced resolution
conditions
- The values unit of SuitabilityMaps must be Int32
- Sum of MinClaims should not exceed the number of land units
- Sum of MaxClaims should be at least the number of land units
- The domain of claims must match the corresponding regions
see also
since version
5.50