Skip to content

jkhamphousone/RingStarProblems.jl

Repository files navigation

Aqua QA

Ring Star Problem variants Solver

Resilient Ring Star Problem

The references:

Introduce the Resilient Ring Star Problem (called 1-R-RSP).

The package can solve 1-R-RSP thanks to:

  • A Branch-and-Benders-cut algorithm (referred to as B&BC)
  • An Integer Linear Programming model (ILP)

Ring Star Problem

Ring Star Problem network

When setting backup_factor=0 or tildeV=0, 1-R-RSP reduces to RSP

The Survivable Ring Star Problem

A Survivable Ring Star Problem solver will be added.

Requirements

JuMP.jl must be installed. You can use CPLEX, GLPK, Gurobi, Xpress or any solver that supports Lazy Constraints callback in JuMP.

Installation

julia> import Pkg ; Pkg.add("RingStarProblems")

Usage

julia> import RingStarProblems as RSP
julia> using JuMP
julia> pars = RSP.SolverParameters(
        solve_mod      = RSP.BranchBendersCut(),   # ILP() or BranchBendersCut()
        F              = 7,                        # total failing time F in days per year, see [`PhD manuscript`](https://theses.hal.science/tel-04319443)
        o_i            = 0,                        # opening costs
        s_ij           = RSP.Euclidian(),          # star costs
        r_ij           = RSP.Euclidian(),          # ring costs
        backup_factor  = 0.01,                     # backup_factor c'=0.01c and d'=0.01c
        alpha          = 3,                        # See [`Labbé et al., 2004`](ttps://doi.org/10.1002/net.10114)
        tildeV         = 100,                      # uncertain nodes set
        writeresults   = RSP.WHTML(),              # output results locally, WLocal(), WHTML() or no output false
        plotting       = false,                    # plot results to subfolder src/plots/results/
        log_level      = 1,                        # console output log_level
        redirect_stdio = false,                    # redirecting_stdio to output file
       )

GLPK

To use GLPK optimizer:

julia> using GLPK
julia> symbolinstance = :TinyInstance_12_2
julia> RSP.rspoptimize(pars, symbolinstance, optimizer_with_attributes(GLPK.Optimizer,
			"msg_lev" => GLPK.GLP_MSG_ALL
	))

Gurobi

To use Gurobi optimizer:

julia> using Gurobi
julia> symbolinstance = :berlin52
julia> RSP.rspoptimize(pars, symbolinstance, Gurobi.Optimizer)

Solving with nodes coordinates

Either:

julia> x = 1:10
julia> y = rand(1:10, 10)
julia> RSP.rspoptimize(pars, x, y, Gurobi.Optimizer)

Or:

julia> xycoors = tuple.(1:10, rand(1:10, 10))
julia> RSP.rspoptimize(pars, xycoors, Gurobi.Optimizer)

Plotting

To plot the solutions in the folder ext/results

julia> using GraphPlot, Compose, Colors
julia> pars.plotting = true

Then call rspoptimize again