I have a college exercise that I need to create a linear programming model from an academic paper. This has to be written in Gusek software which uses GLPK as a resolver. The article defines sets in this way

DOI: https://doi.org/10.1016/j.ijpe.2020.107742 Table of sets

My doubt is on the $ K^i $ set. I don't know how to represent the beginning and the end as the article explains for a model in GLPK code. How could I do it? This doubt therefore solves my doubt about the $N$ and $N^i$ set as well.


1 Answer 1


I'm not familiar with GLPK, but since it's based on AMPL, the following AMPL implementation might be of some help:

set I;
set J;
set K {I};

param J0 {i in I} symbolic = "0" & i;
param JT {i in I} symbolic = "T" & i;

set N {i in I} = {J0[i],JT[i]} union J;
set Nall = (union {i in I} {J0[i],JT[i]}) union J;

GLPK uses only a subset of AMPL, however, so to get these statements to work in GLPK you might need to make some changes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.