Skip to content

Disjunction interface should be simpler #129

@MagicMuscleMan

Description

@MagicMuscleMan

I might be missing something, but why is the interface for disjunctions so complicated? Ideally, the user just enters the disjunction and DisjunctiveProgramming.jl does the reformulation in terms of binary or logical variables.

What the user (ok, I :-)) actually wants is to just enter something like

    for i in 1:P, j in 1:i-1
        @constraint(model, x[i] + width[i] <= x[j] || x[j] + width[j] <= x[i] || y[i] + height[i] <= y[j] || y[j] + height[j] <= y[i])
    end

or maybe something like

    for i in 1:P, j in 1:i-1
        @disjunction(model, [
            x[i] + width[i] <= x[j],
            x[j] + width[j] <= x[i],
            y[i] + height[i] <= y[j],
            y[j] + height[j] <= y[i]])
    end

That some Y is used intermediately for the solver is a detail which is not necessary to formulate the problem as I see it. Such a syntax seems far more readable than what is currently supported (I think. Maybe I am learning something here).

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions