Questions tagged [ampl]

AMPL is an algebraic modeling language for mathematical optimization. It supports a wide range of problems such as linear, quadratic and nonlinear problems in continuous and discrete variables and is connected to most solvers.

AMPL, an acronym for A Mathematical Programming Language, is an algebraic modeling language for describing and solving high-complexity problems for large-scale mathematical computation (i.e. large-scale optimization and scheduling-type problems). It was developed by Robert Fourer, David Gay and Brian Kernighan at Bell Laboratories. AMPL supports dozens of solvers, both open source and commercial, including CBC, CPLEX, FortMP, Gurobi, MINOS, IPOPT, SNOPT and KNITRO.

More on AMPL

AMPL home page

AMPL on Wikipedia

414 questions
3
votes
1 answer

How can I hide CPLEX's output in AMPL?

I want to hide messages like CPLEX 12.5.1.0: integer infeasible. 319 MIP simplex iterations 0 branch-and-bound nodes No basis. I don't mind hiding successful messages or not, but I don't want unsuccessful messages. I have tried option…
Oriol
  • 274,082
  • 63
  • 437
  • 513
3
votes
1 answer

How to assign binary variable in AMPL in respect to another variable

I have a problem with AMPL modelling. Can you help me how to define a binary variable u that suppose to be equall to 0 when another variable x is also equall to 0 and 1 when x is different than 0? I was trying to use logical expressions but solver…
bond_t
  • 141
  • 4
  • 11
3
votes
1 answer

Nonnegative deviation variables in AMPL

I'm using AMPL and need to input my model that has nonnegative deviation variables (s+ - s-). An example constraint is: (x - 5) = (s+ - s-)
user1816907
2
votes
0 answers

AMPL file parser with C++

Is there any parser available for the AMPL format using C++ ? I'm looking for a way to parse and read the data included in files written in AMPL format, within my C++ program
sohaibafifi
  • 745
  • 7
  • 16
2
votes
3 answers

feasiblity problem in CPLEX

Is there an api to solve the feasibility problem (whether a feasible point exists) for a set of convex restraints in CPLEX.
2
votes
1 answer

Error from invalid index/value in pyomo, any tips?

So I'm trying to find an optimal solution to a problem. I tried to copy the format here: https://pyomo.readthedocs.io/en/latest/pyomo_overview/simple_examples.html I made a .dat file and a model.py file but got a strange indexing error, tried to…
Ceeerson
  • 189
  • 8
2
votes
1 answer

AMPL - param that maps from set to set

I'm new to AMPL, and I would like to create a param C that map from a set A to set B: file.mod: set A; set B; param C{i in A} = if i == "AA" then BA else if i == "AB" then BB else if i == "AC" then BC …
Cynnexis
  • 63
  • 1
  • 5
2
votes
1 answer

AMPL implement ILP-formulation

I try to solve a Prize-Collecting-Steiner-Tree-Optimization problem with AMPL. I did find an ILP formulation for that, but now I have problems to implement that into AMPL. Specially the constraint in (c). ILP-formulation I hope somebody can help…
2
votes
2 answers

AMPL: sparse syntax

This code piece in AMPL solves correctly the pair matching algorithm: set Student;. # student tuples inside Student x Student set Pair within {Student, Student}; # sparse value in that tuples param value {Pair}; var x {Pair}…
Paulo Buchsbaum
  • 2,471
  • 26
  • 29
2
votes
5 answers

What is the obvious advantage of using AMPL?

I am doing a project using CPLEX solver, on Netbeans with Java. We have several optimization problems to solve, I have already solved one of them by coding in Java all the constraints, objective and variables, without using AMPL. However, some…
MysteryGuy
  • 1,091
  • 2
  • 18
  • 43
2
votes
3 answers

Reorder dataframe programmatically instead of subseting it

I am trying to transform a dataframe to a specific format in order to export it from R and use it in AMPL. My initial dataframe is the following test <- structure(list(from = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), to = c(1, 2, 3, 1, 2, 3, 1, 2, 3,…
Derek Corcoran
  • 3,930
  • 2
  • 25
  • 54
2
votes
0 answers

Conditional Constraints in AMPL

I am trying to use AMPL to run a single model several times. All variables and parameters have a time dimension as well, since their values change with each iteration of the model. I have defined the model using the problem statement in order to be…
2
votes
1 answer

AMPL Matrix of Varying Sized Sets Generation

I have a question related to AMPL. I'm trying to construct a matrix of sets, named A in the following code (part of the .mod file). This gives an error message of "A is already defined." Please note that S, T are parameters and B is a set in .dat…
herol
  • 49
  • 2
2
votes
1 answer

Python parser for AMPL data file

In many application we need optimization. Usually data on which optimization is required in database or text files. Is there any python parser/utility that reads translate python data structures into AMPL data file so that we can run optimization?
A_Basit
  • 21
  • 2
2
votes
1 answer

Which characteristics from commercial Algebraic Modeling Languages are still missing from open source ones?

Which characteristics the main commercial Algebraic Modeling Languages (AML), like GAMS or AMPL, have, that open source AMLs, like Pyomo or JuMP, do not yet have (aside obviously the user base and availability of established models) ?
Antonello
  • 6,092
  • 3
  • 31
  • 56
1
2
3
27 28