conjure icon indicating copy to clipboard operation
conjure copied to clipboard

Buggy Model for csplib-prob008

Open StephanGocht opened this issue 5 years ago • 4 comments

The model for csplib-prob008 is buggy. It can happen that two containers have the same class in which case the separation function is undefined.

As I understand the problem the intended constraint is class(c1) != class(c2) instead of c1 != c2. This would avoid accessing undefined values of the separation function.

StephanGocht avatar Jul 01 '19 16:07 StephanGocht

This sounds sensible. We already have a function which enforces that containers are not on top of each other.

ChrisJefferson avatar Jul 02 '19 09:07 ChrisJefferson

@ott2 says (over email). I copy it here Andras, to keep the discussion in one place (and visible to @StephanGocht)

The suggested fix is reasonable, but there needs to be a comment noting that the spec assumes that the separation between two containers of the same class is always 0.

There is an issue, since "separation" is defined over distinct pairs of Class elements, so there is never a value for separation(x,x). As the issue suggests, this constraint will then fail (with a silent undefined) if there are ever two different containers from the same class, as occurs with the harder of the two example param files.

The spec seems prematurely optimised. To avoid writing out the whole matrix not only the lower triangle is removed, but also the diagonal.

The fix might depend on the intended semantics. I could certainly see an instance where a certain maximum amount of radioactive isotopes can be placed in a container, but one wants to separate such containers from each other.

ozgurakgun avatar Jul 03 '19 07:07 ozgurakgun

To add,

I wonder if it is at all sensible to have separation between two containers of the same class? If so, would it make sense to change the type of separation to:

separation : function (total) set (maxSize 2) of Class --> int(0..)

I am not sure if this makes sense, I need to remind myself the problem specification, probably after the summer school though :)

ozgurakgun avatar Jul 03 '19 07:07 ozgurakgun

As mentioned in email, this would require the separation function to be defined even for the empty set and singletons.

ott2 avatar Jul 09 '19 09:07 ott2