Skip to content

Commit

Permalink
v0.4.0 (#508)
Browse files Browse the repository at this point in the history
* dev branch to prepare release of 0.4.0

* Move storage & records in ColunaBase (#507)

* Renaming in storage (#509)

* RecordContainer -> RecordWrapper

* state -> record

* rename lot of things, remove getters of Storage not used by Algorithms

* Storage -> StorageUnitWrapper

* Deletion of `AbstractData`  (#510)

* RecordContainer -> RecordWrapper

* state -> record

* rename lot of things, remove getters of Storage not used by Algorithms

* start removing AbstractData structs

* tests ok

* getunit -> getstorageunit;  StorageDict -> Storage

* fix docstring

* Bijection StorageUnit -> Record (#518)

* Bijection StorageUnit -> Record

* address Ruslan's comments

* Implementation of column generation stages  (#525)

* Implementation of column generation stages (for example, heuristic and exact stage)

* Update after conversation with Guillaume + stabilization correction

* Simplification for ColCutGenConquer

* Some more modifs due to Guillaume comments

* Counting the number of exact calls when testing the pricing stages (#530)

* Add bound callback tests (#532)

* add bound callback tests

* include bound callback in runtests

* fix test

* Apply suggestions from code review

Co-authored-by: Guillaume Marques <[email protected]>

* add comment

* Apply suggestions from code review

Co-authored-by: Guillaume Marques <[email protected]>

Co-authored-by: Guillaume Marques <[email protected]>

* Vector of optimizers in `Formulation` (#534)

* vector of optimizers in formulation

* solver_id -> optimizer_id

* add Manifest

* update Manifest

* remove Manifest because does not work

* changes

* rm files

* address Ruslan's comment

* Update src/MathProg/optimizerwrappers.jl

Co-authored-by: Vitor Nesello <[email protected]>

* add Manifest

* change ci

* remove ci change

* rm Manifest

Co-authored-by: Vitor Nesello <[email protected]>

* UnitsUsageDict -> UnitsUsage (#522)

* UnitsUsageDict -> UnitsAccess

* wip

* improve

* tests ok

* Custom data for variables and constraints (#495)

* draft for support of customer data

* custom data in solution

* custom data for cut callback

* computecoeff

* store custom data of solutions in manager

* add Manifest

* rm Manifest

* Support to custom cuts over custom data assigned to columns with new test

* tests ok

Co-authored-by: Artur Alves Pessoa <[email protected]>

* Prototyping custom model/optimizer (#535)

* Start example

* wip draft

* continue

* add map

* works with caching optimizer

* varids in Env

* wrong result

* multiply costs by -1

* fix scaling

* Apply suggestions from code review

* Update test/interfaces/model.jl

Co-authored-by: Lara Pontes <[email protected]>

* Follow up of "custom data" (#538)

* add AbstractCustomData and set/get inc_val

* fix bugs

* remove duplicate methods

* delete unnecessary prefixes and fix some bugs

* revert some changes and update docstring

* custom information for dw sp (#542)

* docstring for restricted master heuristic (#543)

* docstring for restricted master heuristic

* Update src/Algorithm/conquer.jl

* Refactoring `ObjValues` & `OptimizationState` (#544)

* clean + doc

* move doc from objvalues to optstate; tests of objvalues; update ci

* update

* update branching priorioty deprecated method

* tests ok

* tests ok

* tests ok

* delete duplicated tests

Co-authored-by: Ruslan Sadykov <[email protected]>
Co-authored-by: Artur Pessoa <[email protected]>
Co-authored-by: Lara di Cavalcanti Pontes <[email protected]>
Co-authored-by: Vitor Nesello <[email protected]>
Co-authored-by: Lara Pontes <[email protected]>
  • Loading branch information
6 people authored Jun 14, 2021
2 parents c6aba41 + 839786a commit 25ecc41
Show file tree
Hide file tree
Showing 64 changed files with 2,275 additions and 1,595 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- run: julia --project=@. -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/atoptima/ColunaDemos.jl.git"));'
- run: julia --project=@. -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/rafaelmartinelli/KnapsackLib.jl.git"));'
- run: julia --project=@. -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/atoptima/BlockDecomposition.jl.git"));'
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
Expand Down
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name = "Coluna"
uuid = "88b4ec78-b192-11e8-04aa-4d367dd96a64"
authors = ["François Vanderbeck", "Guillaume Marques", "Vitor Nesello", "Ruslan Sadykov"]
version = "0.3.9"
version = "0.4.0"

[deps]
BlockDecomposition = "6cde8614-403a-11e9-12f1-c10d0f0caca0"
ColunaDemos = "a54e61d4-7723-11e9-2469-af255fcaa246"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand All @@ -19,7 +20,7 @@ TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
[compat]
BlockDecomposition = "~1.3"
DataStructures = "0.17, 0.18"
DynamicSparseArrays = "~0.5.0"
DynamicSparseArrays = "0.5"
MathOptInterface = "~0.9.10"
Parameters = "0.12"
TimerOutputs = "0.5"
Expand All @@ -29,7 +30,8 @@ julia = "1"
ColunaDemos = "a54e61d4-7723-11e9-2469-af255fcaa246"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
KnapsackLib = "86859df6-51c5-4863-9ac2-2c1ab8e53eb2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["ColunaDemos", "GLPK", "JuMP", "Test"]
test = ["ColunaDemos", "GLPK", "JuMP", "KnapsackLib", "Test"]
4 changes: 1 addition & 3 deletions docs/src/dev/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Base.diff
Coluna.MathProg.update_ip_primal_bound!
Coluna.Algorithm.OptimizationState
Coluna.MathProg.update_lp_dual_bound!
Coluna.MathProg.getoptimizer
Coluna.MathProg.getmoioptimizer
Coluna.MathProg.update_ip_dual_bound!
Coluna.MathProg.ip_gap_closed
Coluna.Algorithm.add_ip_primal_sol!
Expand All @@ -55,8 +55,6 @@ Coluna.MathProg.MoiOptimizer
Coluna.ColunaBase.Bound
Coluna.Algorithm.set_ip_primal_sol!
Coluna.MathProg.get_ip_dual_bound
Coluna.Algorithm.ReformData
Coluna.Algorithm.ModelData
Coluna.MathProg.get_optimization_target
Coluna.MathProg.create_formulation!
```
Expand Down
36 changes: 16 additions & 20 deletions src/Algorithm/Algorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,18 @@ const MOI = MathOptInterface

import Base: push!

# Import to extend methods to OptimizationState
import ..MathProg:
get_ip_primal_bound, get_ip_dual_bound,
get_lp_primal_bound, get_lp_dual_bound, update_ip_primal_bound!, update_ip_dual_bound!,
update_lp_primal_bound!, update_lp_dual_bound!, set_ip_primal_bound!,
set_ip_dual_bound!, set_lp_primal_bound!, set_lp_dual_bound!, ip_gap, lp_gap, ip_gap_closed, lp_gap_closed

# Utilities to build algorithms
include("utilities/optimizationstate.jl")

include("storage.jl")
include("data.jl")
include("formstorages.jl")

# Abstract algorithm
include("interface.jl")

# Basic algorithms
include("basic/solveipform.jl")
include("basic/solvelpform.jl")
include("basic/solveipform.jl")
include("basic/cutcallback.jl")

# Child algorithms used by conquer algorithms
Expand Down Expand Up @@ -61,25 +53,29 @@ include("treesearch.jl")

# Utilities
export getterminationstatus, setterminationstatus!,
nb_ip_primal_sols, nb_lp_primal_sols, nb_lp_dual_sols,
get_ip_primal_sols, get_lp_primal_sols, get_lp_dual_sols, get_best_ip_primal_sol,
get_best_lp_primal_sol, get_best_lp_dual_sol, update_ip_primal_sol!,
update_lp_primal_sol!, update_lp_dual_sol!, add_ip_primal_sol!, add_lp_primal_sol!,
add_lp_dual_sol!, set_ip_primal_sol!, set_lp_primal_sol!, set_lp_dual_sol!,
get_ip_dual_bound, set_ip_dual_bound!, update_all_ip_primal_solutions!, getreform,
getmasterdata, getoptstate, run!, isinfeasible
update_lp_primal_sol!, update_lp_dual_sol!, add_ip_primal_sol!, add_ip_primal_sols!,
add_lp_primal_sol!, add_lp_dual_sol!, set_ip_primal_sol!, set_lp_primal_sol!, set_lp_dual_sol!,
empty_ip_primal_sols!, empty_lp_primal_sols!, empty_lp_dual_sols!,
get_ip_primal_bound, get_lp_primal_bound, get_lp_dual_bound, get_ip_dual_bound,
set_ip_primal_bound!, set_lp_primal_bound!, set_lp_dual_bound!, set_ip_dual_bound!,
update_ip_primal_bound!, update_lp_primal_bound!, update_lp_dual_bound!, update_ip_dual_bound!,
getoptstate, run!, isinfeasible

# Algorithm's types
export AbstractOptimizationAlgorithm, TreeSearchAlgorithm, ColCutGenConquer, ColumnGeneration,
BendersConquer, BendersCutGeneration, SolveIpForm, SolveLpForm, ExactBranchingPhase,
OnlyRestrictedMasterBranchingPhase, PreprocessAlgorithm, RestrictedMasterIPHeuristic,
OptimizationInput, OptimizationOutput, OptimizationState, ModelData, ReformData,
EmptyInput
BendersConquer, BendersCutGeneration, SolveIpForm, RestrictedMasterIPHeuristic,
SolveLpForm, ExactBranchingPhase, OnlyRestrictedMasterBranchingPhase, PreprocessAlgorithm,
OptimizationInput, OptimizationOutput, OptimizationState, EmptyInput

# Types of optimizers
export MoiOptimize, UserOptimizer

# Units
export PartialSolutionUnitPair, PreprocessingUnitPair
export PartialSolutionUnit, PreprocessingUnit

# Unit functions
export getunit, add_to_solution!, add_to_localpartialsol!
export add_to_solution!, add_to_localpartialsol!

end
8 changes: 4 additions & 4 deletions src/Algorithm/basic/cutcallback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ struct RobustCutCallbackContext
proj_sol::PrimalSolution # ordered non zero but O(log^2(n)) lookup time
proj_sol_dict::Dict{VarId, Float64} # O(1) lookup time
viol_vals::Vector{Float64}
orig_sol::PrimalSolution
end

# CutCallbacks does not have child algorithms, therefore get_child_algorithms() is not defined

function get_units_usage(algo::CutCallbacks, form::Formulation{Duty}
) where {Duty<:MathProg.AbstractFormDuty}
return [(form, MasterCutsUnitPair, READ_AND_WRITE)]
return [(form, MasterCutsUnit, READ_AND_WRITE)]
end

function run!(algo::CutCallbacks, env::Env, data::ModelData, input::CutCallbacksInput)
form = getmodel(data)
function run!(algo::CutCallbacks, env::Env, form::Formulation, input::CutCallbacksInput)
robust_generators = get_robust_constr_generators(form)
nb_ess_cuts = 0
nb_fac_cuts = 0
Expand All @@ -55,7 +55,7 @@ function run!(algo::CutCallbacks, env::Env, data::ModelData, input::CutCallbacks
continue
end
context = RobustCutCallbackContext(
form, env, constrgen.kind, projsol1, projsol2, cur_viol_vals
form, env, constrgen.kind, projsol1, projsol2, cur_viol_vals, input.primalsol
)
constrgen.separation_alg(context)
if constrgen.kind == Facultative
Expand Down
Loading

0 comments on commit 25ecc41

Please sign in to comment.