GithubHelp home page GithubHelp logo

reganbaucke / judge.jl Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 3.0 10.08 MB

An interface for solving a stochastic capacity expansion problem via a Dantzig-Wolfe decomposition algorithm

License: Other

Julia 74.68% JavaScript 2.91% HTML 21.93% CSS 0.48%

judge.jl's People

Contributors

adow031 avatar odow avatar reganbaucke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

judge.jl's Issues

Risk aversion

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.

problem data not related to a node

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.

Continuous expansion variables

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.

Model ouput

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.

Parallel

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.

DelimitedFiles fails for CI

This environment fails when loading DelimitedFiles during the CI, the other two pass.

          - version: '1'
            os: ubuntu-latest
            arch: x64

Investments must lead to lower costs in the subproblems

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.

Set up a flag to switch the problem to be maximization

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).

Get parallelisation working

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.

Quadratic objective

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.

Annualized costs

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.

Expansion variables in objective function

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.

Examples

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.

Maximisation problems

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.

Deterministic equivalent

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.

Online documentation

Create online documentation detailing how to set up trees, expansion variables, sub_problems and overall models.

print_expansions

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.

Upgrade to Julia 1.x

This will likely require a significant change to the way variables and constraints are dynamically generated.

Example for branch and price

Create an example which gives a fractional optimal solution for master problem. Demonstrate the features of Julia's branch and price functionality.

Solver breaks when running cbc

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.