I have a binary program and one of my variables, x_it is defined on two sets, being I: Set of objects and T: Set of the weeks of the year, thus x_it is a binary variable standing for whether object i is assigned to something on week t. The constraint I failed to implement in AMPL/GNU Mathprog is that if x_it equals to 1 then x_i(t+1) and x_i(t+2) also should take value of 1. Is there a way to implement this constraint in a simple mathematical programming language?
Implementing a constraint based on previous variable's value in GNU Mathprog/AMPL
284 Views Asked by oakenshield1 At
1
There are 1 best solutions below
Related Questions in LINEAR-PROGRAMMING
- Specifying greater than inequality in scipy
- How to convert quadratic to linear program?
- Difference between GLP_DUAL and GLP_DUALP in GLPK method
- Minimum exact cover of grid with squares; extra cuts
- How to use glp_exact to simplex method in glpk matlab
- Heuristic to find the maximum weight independent set in an arbritary graph
- R: Isotonic regression Minimisation
- Algorithm to find the most valuable combination?
- defining linear equations in Java
- Using the Karmarkar method in Scilab
- Where is the error in this job scheduling model/instance?
- adding constraint under pyomo environment
- Cplex best current solution
- CVXOPT + GLPK - Extract lagrange multiplier from LP solution
- Soft constraints in gurobi
Related Questions in AMPL
- MathProg max() function complains about wrong arguments
- CPM Cost modelation
- GNU MathProg: symbolic set vs. integer set
- Using gurobi with java vs gurobi with ampl
- Ampl Indexing expressions using colons error: variable in such-that part of set specification
- AMPL nonquadratic nonlinear constraints with cplex
- Selecting a solver & modeling language for optimization problems
- How to print to file in AMPL? `option log_file` doesn't work
- How can I get the number of iterations in AMPL?
- Limitations of AMPL regarding large problems
- Get variable results from failed run in neos using bonmin for a MINLP
- AMPL syntax error - constraint over indexed set
- Can't use fractional variable in AMPL
- Handy way to index set of tupple in AMPL
- How can I do elementwise operation on parameter vectors in AMPL
Related Questions in INTEGER-PROGRAMMING
- How to convert quadratic to linear program?
- Minimum exact cover of grid with squares; extra cuts
- adding constraint under pyomo environment
- GAMS indexing query
- Relaxing binary variable but having the same solution
- Construction heuristics in binary integer programming
- Mixed integer programming with quadratic obj and quadratic constraints?
- Arbitrary precision integer programming solvers?
- How do I get the minimum positive value over a set of integer expressions?
- How to schedule different types of planks to form bridges
- Error in check_for_unknown_vars_impl(model, the_ast) : The expression contains a variable that is not part of the model
- Library for solving knapsack-prblm(integer-programming)
- Get best-known feasible answer after time limit
- How to convert the following if-else conditions to Linear integer programming constraints?
- Keeping count of variable occurence in google OR Tools
Related Questions in MATHPROG
- MathProg max() function complains about wrong arguments
- Error : out of domain error mathprog
- Where is the error in this job scheduling model/instance?
- GNU MathProg: symbolic set vs. integer set
- How can I bound a variable to be negative in GMPL linear programming (Gusek)?
- What am i doing wrong with the math?
- Known values for variables in a linear program written in Mathprog
- Implementing a constraint based on previous variable's value in GNU Mathprog/AMPL
- Multiplication of linear forms not allowed error
- Infeasable solution for rock-paper-scissors in matrix game (GLPK)
- Syntax error with Glpk: MathProg model processing error
- Issues with objective - GMPL
- Solving Steiner Tree with GLPK
- GLPK MathProg - conditional constraint
- Can't figure out how to resolve reduce/reduce conflict
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The implication you want to implement is:
AMPL supports implications (with the ==> operator), so we can write this directly. MathProg does not.
A simple way to implement the implication as straightforward linear inequalities is:
This can easily be expressed in AMPL, MathProg, or any modeling tool.
This is the pure, naive translation of the question. This means however that once a single
x(i,t)=1all followingx(i,t+1),x(i,t+2),x(i,t+3)..=1. That could have been accomplished by just the constraintx(i,t+1) >= x(i,t).A better interpretation would be: we don't want very short run lengths. I.e. patterns: 010 and 0110 are not allowed. This is sometimes called a minimum up-time in machine scheduling and can be modeled in different ways.
Forbid the patterns 010 and 0110:
The pattern 01 implies 0111:
Both these approaches will prevent patterns 010 and 0110 to occur.