I have a general question about the effect of 'unused' variables on the result and runtime of optimization algorithms. I try to explain my question by giving an example. Let's say I have 2 type of buildings that I want to model. They have flexible electrical consumers that can vary their electrical power. We also have a time-dependent price for electricity for one day. So basically the task is a scheduling problem that can for example be modelled as a mixed-integer linear problem.
Let's say buildings from type 1 have two flexible electrical consumers:
- A heat pump (electrical heating element) with a maximum electrical Power of P_HP and a binary (or continuous) decision variable x(t) between [0,1] for x(t) in {1,2,3,...,24}.
- An electric vehicle with a maximum electrical power of P_EV and a binary (or continuous) decision variable x(t) between [0,1] for y(t) in {1,2,3,...,24}.
So the current electrical power for a time slot t for the heat pump is P(t)= x(t) *P_HP for every hour of the day. Analogously, the current electrical power for a time slot t for the electric vehicle is calculated P(t)=y(t) * P_EV. Of course I have several constraints for the devices and and objective function that depend on x(t) and y(t).
Building type 2 also has the heat pump as the flexible device but does not have an electric vehicle. Now I come to my question. What effect does it have on the optimization if I model building type 2 exactly like building type 1 but set the maximum (and minimum) power of the electric vehicle P_EV to 0? By doing so, the decision variable y(t) would not have any effects on any constraint and on the objective function and thus can be labelled as 'unused'. But still they are incorporated in the optimization and the number of variables is surely increased by that. Another way would be to use a different model for building type 2 and exclude the variables and the constraints for the electric vehicle. Thus, I would reduce the number of decision variables and constraints for building type 2 but the effort for modelling will be higher as I would have to model building type 2 separately instead of just adjusting the parameters for them.
My concrete questions are:
- What effect do such 'unused' variables have on the runtime and the result of the optimization? We now have more decision variables but all of them could just take any value as they do not influence anything.
- From a modelling perspective: Is it advisable to use such variables or not? I mean the model of all buildings would be exactly the same which reduces the lines of code and the time to implement it. However, the model would not be really "correct" for certain building types as it would include variables and constraints that are not really existing for those building types.
What is your experience regarding theses questions? I'd highly appreciate every comment and every shared experience. The motivation for my question is that in fact I have not 2 but 20 different building types with different combinations of flexible electrical consumers.