Skip to content

Commit

Permalink
Start doc for algorithms (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
guimarqu authored May 23, 2020
1 parent 5f4c28c commit 1f73517
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ makedocs(
"Callbacks" => "user/callbacks.md"
],
"Reference" => Any[
"Algorithms" => "dev/algorithms.md",
"Formulation" => "dev/formulation.md"
]
]
Expand Down
22 changes: 22 additions & 0 deletions docs/src/dev/algorithms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```@meta
CurrentModule = Coluna.Algorithm
DocTestSetup = quote
using Coluna.Algorithm
end
```

# Algorithms

```@docs
TreeSearchAlgorithm
```

```@docs
ColGenConquer
```

```@docs
ColumnGeneration
SolveIpForm
SolveLpForm
```
21 changes: 21 additions & 0 deletions src/Algorithm/colgen.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
"""
Coluna.Algorithm.ColumnGeneration(
restr_master_solve_alg = SolveLpForm(get_dual_solution = true)
pricing_prob_solve_alg = SolveIpForm(
deactivate_artificial_vars = false,
enforce_integrality = false,
log_level = 2
),
max_nb_iterations::Int = 1000
optimality_tol::Float64 = 1e-5
log_print_frequency::Int = 1
store_all_ip_primal_sols::Bool = false
redcost_tol::Float = 1e-5
cleanup_threshold::Int = 10000
cleanup_ratio::Float = 0.66
)
Column generation algorithm. It applies `restr_master_solve_alg` to solve the linear
restricted master and `pricing_prob_solve_alg` to solve the subproblems.
"""
Base.@kwdef struct ColumnGeneration <: AbstractOptimizationAlgorithm
restr_master_solve_alg = SolveLpForm(get_dual_solution = true)
#TODO : pricing problem solver may be different depending on the
Expand Down
13 changes: 13 additions & 0 deletions src/Algorithm/conquer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ end
# ColGenConquer
####################################################################

"""
Coluna.Algorithm.ColGenConquer(
colgen::ColumnGeneration = ColumnGeneration()
mastipheur::SolveIpForm = SolveIpForm()
preprocess::PreprocessAlgorithm = PreprocessAlgorithm()
run_mastipheur::Bool = true
run_preprocessing::Bool = false
)
Column-generation based algorithm to find primal and dual bounds for a
problem decomposed using Dantzig-Wolfe paradigm. It applies `colgen` for the column
generation phase, `masteripheur` to optimize the integer restricted master.
"""
Base.@kwdef struct ColGenConquer <: AbstractConquerAlgorithm
colgen::ColumnGeneration = ColumnGeneration()
mastipheur::SolveIpForm = SolveIpForm()
Expand Down
11 changes: 8 additions & 3 deletions src/Algorithm/solveipform.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
"""
SolveIpForm
Coluna.Algorithm.SolveIpForm(
time_limit::Int = 600,
deactivate_artificial_vars = true,
enforce_integrality = true,
silent = true,
log_level = 0
)
todo
Solve ip formulation
Solve a mixed integer linear program.
"""
Base.@kwdef struct SolveIpForm <: AbstractOptimizationAlgorithm
time_limit::Int = 600
Expand Down
9 changes: 7 additions & 2 deletions src/Algorithm/solvelpform.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
"""
SolveLpForm
Coluna.Algorithm.SolveLpForm(
get_dual_solution = false,
relax_integrality = false,
set_dual_bound = false,
silent = true
)
todo
Solve a linear program.
"""
Base.@kwdef struct SolveLpForm <: AbstractOptimizationAlgorithm
get_dual_solution = false
Expand Down
13 changes: 10 additions & 3 deletions src/Algorithm/treesearch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,17 @@ get_tree_order(data::TreeSearchRuntimeData) = data.tree_order
getoptstate(data::TreeSearchRuntimeData) = data.optstate

"""
TreeSearchAlgorithm
Coluna.Algorithm.TreeSearchAlgorithm(
conqueralg::AbstractConquerAlgorithm = ColGenConquer(),
dividealg::AbstractDivideAlgorithm = SimpleBranching(),
explorestrategy::AbstractTreeExploreStrategy = DepthFirstStrategy(),
maxnumnodes::Int = 100000,
opennodeslimit::Int = 100
)
This algorithm uses search tree to do optimization. At each node in the tree, we apply
conquer algorithm to improve the bounds and divide algorithm to generate child nodes.
This algorithm uses search tree to do optimization. At each node in the tree, it applies
`conqueralg` to improve the bounds, `dividealg` to generate child nodes, and `explorestrategy`
to select the next node to treat.
"""
Base.@kwdef struct TreeSearchAlgorithm <: AbstractOptimizationAlgorithm
conqueralg::AbstractConquerAlgorithm = ColGenConquer()
Expand Down

0 comments on commit 1f73517

Please sign in to comment.