psrenergy / ToQUBO.jl

🟦 JuMP ToQUBO Automatic Reformulation
https://psrenergy.github.io/ToQUBO.jl
Other
27 stars 2 forks source link

Implement semiinteger & semicontinuous variable encodings #73

Open pedromxavier opened 1 year ago

pedromxavier commented 1 year ago

Implement encoding for $x \in \{0\} \cup X$.

One option is to write

$$ \xi[\{0\} \cup X](\mathbf{y}; z) = z ~ \xi[X] (\mathbf{y}) $$

where $(\mathbf{y}; z) \in \mathbb{B}^{n + 1}$.

bernalde commented 1 year ago

I think this is the right way. This reformulation also works for disjunction $[y_i, x \in X_i]$ or equivalently indicator variables $y_i \to x \in X_i$ https://www.gurobi.com/documentation/9.5/refman/py_model_agc_indicator.html

pedromxavier commented 1 year ago

Sure, for $x \in A \cup B$,

$$ \xi[A \cup B](\mathbf{y}; z) = z ~~ \xi[A] (\mathbf{y}) + (1 - z) ~~ \xi[B] (\mathbf{y}) $$

or even

$$ \xi \left[ \bigcup{j = 1}^{n} X{j} \right](\mathbf{y}; \mathbf{z}) = \sum{j = 1}^{n} z{j} ~~ \xi[X{j}] (\mathbf{y}) ~~ \textrm{s.t.} ~~ \sum{j = 1}^{n} z_{j} = 1$$

bernalde commented 1 year ago

You are reinventing Disjunctive Programming! Let's go!