gamma-opt/DecisionProgramming.jl

Variable consequences and linear expressions as path utility values

jaantollander opened this issue · 0 comments

As demonstrated by the contingent portfolio programming example, the path utility functions allow using numerical, linear, and integer-linear JuMP expressions as values for path utilities when forming positive path utility and conditional value-at-risk. Linear path utilities lead to quadratic formulations of expected value and conditional value-at-risk, which Gurobi can solve.

We can modify consequences such that it allows both real numbers and JuMP variables as values. The variables must have lower and upper bounds.

const RealOrVar = Union{<:Real, VariableRef}

struct Consequences{N} <: AbstractArray{RealOrVar, N}
    j::Node
    data::Array{RealOrVar, N}
end

The PathUtility <: AbstractPathUtility structure should have methods for:

  • querying the expression for a path, and
  • querying a value for a path after optimization is complete.

Something similar to this snippet:

struct PathUtility <: AbstractPathUtility
    data::Array{AffExpr}
end

Base.getindex(U::PathUtility, i::Int) = getindex(U.data, i)
Base.getindex(U::PathUtility, I::Vararg{Int,N}) where N = getindex(U.data, I...)
(U::PathUtility)(s::Path) = value.(U[s...])

We need to modify the expected value objective as follows:

function expected_value(model::Model, π_s::Array{VariableRef}, S::States, U::AbstractPathUtility)
    @expression(model, sum(π_s[s...] * U[s...] for s in paths(S)))
end

Then creating a path utility and setting an expected value objective works as follows:

function PathUtility(model, V, Y, S)
    # ...
    PathUtility([@expression(model, ...) for s in paths(S)])
end

U = PathUtility(model, V, Y, S)
EV = expected_value(model, π_s, S, U)
@objective(model, Max, EV)

We need optimization formulations for determining:

  • minimum path utility,
  • maximum path utility, and
  • the smallest positive difference between path utilities (if the conditional value-at-risk formulation can be extended to use linear path utility values).

We can supply these values as arguments to the positive path utility and conditional value-at-risk functions.

We can also use path utilities as objectives with positive expected value as a constraint by allowing expressions.