How to get all the registered variable names of a `JuMP` model?

Is there any method to obtaining all the registered variable names (symbols) of a JuMP model? And, if the variables have been set String names, how to get their original symbolic names?

1 Like

See object_dictionary(model), JuMP · JuMP, which maps the registered name to the object.

There is no way to go from a variable to the symbolic name. You’ll need to invert the object_dictionary for that.

2 Likes

Thanks!

2 Likes