Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement semiinteger & semicontinuous variable encodings #73

Open
pedromxavier opened this issue Apr 16, 2023 · 3 comments
Open

Implement semiinteger & semicontinuous variable encodings #73

pedromxavier opened this issue Apr 16, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@pedromxavier
Copy link
Member

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}$.

@pedromxavier pedromxavier added the enhancement New feature or request label Apr 16, 2023
@pedromxavier pedromxavier self-assigned this Apr 16, 2023
@bernalde
Copy link
Collaborator

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
Copy link
Member Author

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
Copy link
Collaborator

You are reinventing Disjunctive Programming! Let's go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants