Questions tagged [ampl]

For questions related to the algebraic modeling language AMPL.

Filter by
Sorted by
Tagged with
10
votes
1answer
374 views

Comparison of Algebraic modelling languages and general programming languages

Some optimization software/frameworks (commercial or open-source) such as AMPL, GAMS, Cplex, ... have a specific Algebraic modelling language. Some of them have another type of programming that uses ...
8
votes
1answer
145 views

Understanding the AMPL Solver LIbrary within Pyomo

For anyone familiar with the Pyomo book, it occasionally makes reference to the AMPL Solver Library, and to my understanding, if you can manage to hook up to the solver library then you are able to ...
7
votes
3answers
189 views

Constraint that checks for an undirected graph whether it is connected?

I would like to create a constraint with AMPL that checks whether I am able to reach from one node $v$ to all other nodes of a set but I don't really know how to formulate it (especially in AMPL (+...
7
votes
2answers
208 views

Matrix in ampl: constraint that the values ​are all different

I'm solving the magic square problem for my operational research exam. The constraints of my model are that the sum of the elements on the lines must be equal to a constant (var constant), that the ...
6
votes
1answer
59 views

Issue interpreting sets of constraints in AMPL

I'm new to AMPL and am trying to model the following constraints. \begin{align}y_{ij3}&\le\sum_\ell X_{j\ell2}\quad(m=2,k=3)\\y_{ijk}&\le\sum_\ell\sum_mx_{j\ell m},\quad\forall i\in I,\forall ...
6
votes
1answer
118 views

Obtaining the intermediate solutions in AMPL

I know that for some solvers, for example, the constraint programming solver in Google OR-Tools, it is possible to see all the intermediate solutions that the solver finds while it searches for an ...
5
votes
2answers
63 views

AMPL implement constraint

I'm trying to implement the following in AMPL: $$ i \in [N], j \in[N] \backslash \{i\}, t \in [T] $$ I have so far written the following: ...
5
votes
1answer
60 views

How to formulate case distinctions in AMPLs objective function?

This is my first real optimisation problem I formulated and now trying to solve by using AMPL. The following objective function is from a linear 0-1 LP means all variables $x_i^b\in\{0,1\}$, with $i\...
4
votes
2answers
239 views

Combinatorial Optimization using AMPL

I want to solve the following integer programming problem using AMPL. The problem is the following (It was already asked on mathstackexchange.com, but I need to know how to solve it using AMPL): Let $...
4
votes
1answer
69 views

Declare numerical-sequence set in AMPL .dat file

Suppose I want an AMPL set to contain the integers 1 through 5. How can I declare this in the .dat file? I can do it in the .mod file, like this: things.mod: ...
3
votes
1answer
69 views

Find a particular optimal solution

After writing an integer linear program in AMPL, I solved it using CPLEX. Now, I have some variables that must necessarily be 1, others that must necessarily be 0 and finally it is possible that some ...
3
votes
1answer
80 views

How to define hybrid variables without using additional binary variables?

I am working on a large NLP model with equilibrium equations in which the variables are defined in the following form: $$x_i \in [L_B, U_B] \cup\{0\} \quad \text{where} \quad L_B \ \& \ U_B \in\...
3
votes
1answer
55 views

How to set combined stop condition in AMPL/CPLEX?

I would like to set a stop condition combined of a timelimit and a relative MIP gap. So I would like AMPL/CPLEX to look for the solution of my LP for an hour and if there isn't a solution stop if or ...
3
votes
0answers
59 views

Integer variable optimization - decreasing execution time

I have a variable declared as follows in AMPL: ...