DecisionProgramming.jl icon indicating copy to clipboard operation
DecisionProgramming.jl copied to clipboard

Efficient model construction with inactive chance states

Open jaantollander opened this issue 4 years ago • 0 comments

When there are inactive chance states (zero probability) in the model, the model currently creates path probability variables and fixes them to zero. We could avoid creating the fixed variables altogether by using a dictionary (as a sparse multidimensional array) instead of (a dense, multidimensional) array of path probability variables. We can then efficiently create decision models (faster and less memory usage) create decision models when there are many inactive chance states. Also, there is less unnecessary variables or constraints for the solver to remove.

These improvements do not require changes to API, only some changes to the internals of the following functions in decision_model.jl:

  • path_probability_variables: Create path probability variables by deterministically iterating over paths without inactive chance states. Store variable in the dictionary. We also need to implement the deterministic iterator.
  • probability_cut
  • active_paths_cut
  • expected_value
  • conditional_value_at_risk

We need to check that the changes do not cause any performance regressions.

jaantollander avatar Oct 17 '20 09:10 jaantollander