reganbaucke / judge.jl Goto Github PK
View Code? Open in Web Editor NEWAn interface for solving a stochastic capacity expansion problem via a Dantzig-Wolfe decomposition algorithm
License: Other
An interface for solving a stochastic capacity expansion problem via a Dantzig-Wolfe decomposition algorithm
License: Other
It should be possible to add a CVaR risk measure to the master problem. Some research will be needed to ensure that the dual information will still lead to a convergent column generation algorithm.
Since the number of leaf nodes is relatively small, I would think that an end-of-horizon risk measure would be tractable.
In the knapsack problem, we demonstrate how we can access problem data associated with each node i.e. n.data
. This allows the user to easily write the subproblems.
Some problem data is not associated with particular nodes, for example investvol
and initialcap
.
In the tutorial, this problem data is sitting in the global scope. Because we build the model in the global scope, this doesn't present any problems. However I believe it would be cleaner if we added a field to the JuDGETree which stored problem data not related to each node.
Then this data can be passed into JuDGEsubproblem!(m) do sp,n,expansion,data
, and
JuDGEexpansioncosts!(m) do master,n,expansion,data
.
Of course this data could be stored in the data
field in each node, but this would require the same data to be copied across each node.
We would like to extend JuDGE to allow for continuous expansion variables. In the current implementation of JuDGE, we only allow for binary variables. Continuous expansion variables will require redefining the @expansion macro to allow for :Bin or :Cont. As far as the mathematics behind this, I'm not sure how this works.
Currently the output of the model (values of expansion variables) is cryptically stored in master_problem
of the JuDGE model.
Use this thread as a discussion about how to remedy this.
Currently no support for parallel processing of sub problems. Use this thread as a discussion for what this feature (and its interface) might look like.
This environment fails when loading DelimitedFiles during the CI, the other two pass.
- version: '1'
os: ubuntu-latest
arch: x64
It is possible for models to be constructed, whereby in certain nodes of the tree, the subproblem cost is lower if the investment is removed. This will lead to the master problem selecting a column that perhaps does not respect the presence an earlier investment.
(a) It should be clear in the documentation that this situation is not supported by the decomposition. Of course the deterministic equivalent will account for this, leading to a divergence of the two models.
(b) A function could be added to test if this issue has occurred, identifying the nodes and investments that have caused the problem.
Since each subproblem is defined independently, it's technically possible to set some nodes to be maximization, and others to be minimization - this doesn't really make sense, given that the investment costs will later be added to those objectives.
Either we should set a flag to set the master to a either min or max, and then check that the subproblems are compliant, or state clearly that JuDGE will only work with minimization problems and force the user to set up their problem in that form (with appropriate checks / warnings).
An error is thrown when a MathOptInterface.Integer variable is included in the deteq model. The relevant error reads as:
Building deterministic equivalent problem...ERROR: LoadError: Unsupported constraint type found: MathOptInterface.Integer
The getting_started.md
is currently out-of-date.
It should be an option to solve the subproblems in parallel.
Note that the algorithm does not require all subproblems to be solved in order to construct new columns in the master problem. The user could specify a time limit for each iteration and force the model to return the best incumbents from the subproblems.
In the knapsack constraint, the coefficients of the expansion variables, and the initial capacity, must be fixed between nodes.
The current interface allows the user to circumvent this requirement of JuDGE.
It would be nice to have some functions that are able to read from the JuDGEModel
the expansion policy while not necessarily printing it out via print_expansions
. Further there should be a way to pick out a node, supply a expansion policy to the node, solve the subproblem at the node, and recover the minimisers for the subproblem.
Long-term goal.
If a quadratic term is included in the objective function, then the deterministic equivalent does not get built correctly.
Quadratic objective functions have not been tested for the Dantzig-Wolfe decomposition either.
Hi, If I use annualized costs, the investment costs of the first stage expansions should be fixed costs for the following stages. How can I implement this? Thanks.
There is currently no check to ensure that expansion variables do not belong in sub problem constraints. Without this check, the user could specify an illegal JuDGE Model.
The deterministic equivalent code now supports quadratic constraints. By creating a dummy variable, this can also model quadratic objective functions; however, it would be good to support this explicitly.
Currently no examples at this point.
I would suggest a few examples of building trees (independent of the optimisation part of JuDGE).
test_three
in test/judge
could form the basis of an example demonstrating the optimisation part of judge.
Provide several examples with online documentation.
The user is currently only free to specify minimisation problems. There is no reason why we cannot support maximisation problems. This will likely require some refactoring of the code in many different places, as well as at both a high and low level.
In the same way that the master problem is automatically generated, we would like to generate a deterministic equivalent JuMP model based off of the definition of the sub-problems. This would allow users to test that "JuDGEsolve" works in the way we expect it to; or even show when JuDGEsolve fails to return a naturally integer solution.
Create online documentation detailing how to set up trees, expansion variables, sub_problems and overall models.
The deterministic equivalent version of print_expansions
needs to be changed to underscore_case. Further if the expansion variable is not an array, print_expansion
breaks. print_expansions
needs to discern between JuMP.Variable
, JuMP.JuMPArray
, and JuMP.AbstractArray
.
This will likely require a significant change to the way variables and constraints are dynamically generated.
I don't have permission to cancel the existing workflows, but you might want to https://github.com/reganbaucke/JuDGE.jl/actions/workflows/ci.yml
One of the examples is taking ages and not looking like it is going to converge?
Know which one?
Not sure if @adow031 can turn this on, but try going to https://app.codecov.io/gh/reganbaucke/JuDGE.jl/settings, log-in with your GitHub account, and then see if you can flick a switch to turn on code coverage.
If not, @reganbaucke might have to do it.
Create an example which gives a fractional optimal solution for master problem. Demonstrate the features of Julia's branch and price functionality.
I am running JuDGE on the the knapsack example. I am using Cbc as I don't have access to Gurobi. I have made the required edits to knapsack.jl in order to use Cbc.
The following is the stacktrace:
ERROR: LoadError: Invalid coefficient NaN on variable extrabags[1]
Stacktrace:
[1] assert_isfinite(::JuMP.GenericAffExpr{Float64,JuMP.Variable}) at C:\Users\Regan.julia\v0.6\JuMP\src\affexpr.jl:124
[2] prepAffObjective(::JuMP.Model) at C:\Users\Regan.julia\v0.6\JuMP\src\solvers.jl:501
[3] #build#136(::Bool, ::Bool, ::JuMP.ProblemTraits, ::Function, ::JuMP.Model) at C:\Users\Regan.julia\v0.6\JuMP\src\solvers.jl:328
[4] (::JuMP.#kw##build)(::Array{Any,1}, ::JuMP.#build, ::JuMP.Model) at .<missing>:0
[5] #solve#133(::Bool, ::Bool, ::Bool, ::Array{Any,1}, ::Function, ::JuMP.Model) at C:\Users\Regan.julia\v0.6\JuMP\src\solvers.jl:168
[6] iteration(::JuDGE.JuDGEModel) at C:\Users\Regan\Desktop\test\JuDGE.jl\src\JuDGE.jl:314
[7] JuDGEsolve!(::##7#8, ::JuDGE.JuDGEModel, ::Cbc.CbcMathProgSolverInterface.CbcSolver) at C:\Users\Regan\Desktop\test\JuDGE.jl\src\JuDGE.jl:258
[8] include_from_node1(::String) at .\loading.jl:576
[9] include(::String) at .\sysimg.jl:14
while loading C:\Users\Regan\Desktop\test\JuDGE.jl\example\knapsack.jl, in expression starting on line 55
It looks as though Cbc returns a Nan somewhere, and then JuDGE has updated a coefficient with NaN, which then gets passed back to Cbc, who then breaks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.