E-CE0011 — min/max over an empty collection

Error Type

Compile Error

Phase

compiling the problem into an OMMX instance

Python exception

ValueError

Message

`{operator}` requires a non-empty collection.

Possible fix: ensure the iterated range, set, or array is non-empty.

Cause

A fold such as min or max was evaluated over a collection that turned out to be empty for the given instance data. Unlike sum or prod, these operators have no neutral element and are undefined on empty input.

Fix

Ensure the iterated range or set is non-empty for every instance (e.g. that array lengths and range bounds are at least 1), or restructure the model to use sum/prod, which are well-defined on empty collections.