I am trying to finde some examples of making a preselection of a mpvar that should be the result of the function optimized. I have a graph of nodes (vertices), and I should solve the common Spanning Tree, but I would like only to make the "search" of the minimum cost spanning tree between some edges. For example I have 500 nodes (vertices), all the potentially "selectable" edges (through the mpvar) are 500*500, but I would like to make an initial selection by pre-selecting only about 700 edges. I found how to solve a minimum cost spanning tree in the book of Xpress Optimizer applications ("12.4 Construction of a cabled network") and it reads from a matrix which states the cost from a node to another one. How to pre-select edges (i.e. nodes connections) to make the optimizer solve faster?

I hope to have been clear, thank you in advance for any help.

If you do not wish to work with the full set of (Nodes*Nodes) potential edges, I would recommend that you only create those variables that are actually needed by employing a "dynamic array". See the discussion of this topic in section "3.2 A transport example" of the Mosel User Guide.

You might also want to take a look at the implementation of the decision variable array 'flow' this model: https://examples.xpress.fico.com/example.pl?id=mosel_book_6_7b

If you wish to prioritize branching on certain variables, you could define branching directives, eg in a Mosel model (directives need to be stated before the call to maximize/minimize):

forall(i in MySet) do

setmipdir(x(i), XPRS_PR, 1) ! values1..1000 where smaller values mean higher priority

setmipdir(x(i), XPRS_UP) ! first branch upwards

end-do