Skip to content

rafaelmartinelli/FacilityLocationProblems.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FacilityLocationProblems.jl

Stable Dev Build Status Coverage Project Status: Active – The project has reached a stable, usable state and is being actively developed.

This package reads data files for different location problems instances:

  • (Capacitated) Facility Location Problems
  • (Capacitated) P-Median Problems
  • Maximum Coverage Problems

Usage

Capacitated Facility Location Problems

The type used by (Capacitated) Facility Location Problems is FacilityLocationProblem, defined as follows:

struct FacilityLocationProblem
    name::String                 # Instance name

    capacities::Vector{Int64}    # Facilities capacities
    demands::Vector{Int64}       # Customers demands
    fixed_costs::Vector{Float64} # Fixed costs to open facilities
    costs::Matrix{Float64}       # Costs to assign facilities to customers

    lb::Float64                  # Lower bound (-Inf if not known)
    ub::Float64                  # Upper bound ( Inf if not known)
end

Some classical instances from the literature can be downloaded on demand from ORLib page. For example, to download and load instance cap41:

data = loadFacilityLocationProblem(:cap41)

See the full list on ORLib UFLP page, ORLib CFLP page or call the function getFacilityLocationInstances.

Optionally, it is possible to set the facilities' capacity (mandatory for instances capa, capb, and capc):

data = loadFacilityLocationProblem(:capa, 8000)

(Capacitated) P-Median Problems

The type used by (Capacitated) P-Median Problems is PMedianProblem, defined as follows:

struct PMedianProblem
    name::String           # Instance name

    medians::Int64         # Number of medians (p)
    capacity::Int64        # Medians capacities

    demands::Vector{Int64} # Customers demands
    costs::Matrix{Float64} # Costs matrix (distances)

    x::Vector{Int64}       # Customers x coordinates
    y::Vector{Int64}       # Customers y coordinates

    lb::Float64            # Lower bound (-Inf if not known)
    ub::Float64            # Upper bound ( Inf if not known)
end

Some classical (Capacitated) P-Median instances from the literature are preloaded. For example, to load instance pmedcap01:

data = loadPMedianProblem(:pmedcap01)

See the full list or call the function getPMedianInstances.

Maximum Coverage Problems

The type used by Maximum Coverage Problems is MaximumCoverageProblem, defined as follows:

struct MaximumCoverageProblem
    name::String                    # Instance name

    medians::Int64                  # Number of medians (p)
    distance::Int64                 # Coverage distance

    demands::Vector{Int64}          # Customers demands
    coverage::Vector{Vector{Int64}} # Coverage sets

    x::Vector{Int64}                # Customers x coordinates
    y::Vector{Int64}                # Customers y coordinates

    lb::Float64                     # Lower bound (-Inf if not known)
    ub::Float64                     # Upper bound ( Inf if not known)
end

The package loads Capacitated P-Median instances as Maximum Coverage Problems, and the user must input the maximum coverage distance. For example, to load instance pmedcap01 with maximum coverage distance of 10:

data = loadMaximumCoverageProblem(:pmedcap01, 10)

The medians capacities are ignored, and the coverage sets are built using calculated costs and given coverage distance.

Other Features

This package also loads custom instances (following ORLib format):

data = loadTypeOfProblem("/path/to/your/instance.txt", optional_arguments)

Installation

FacilityLocationProblems is a registered Julia Package (yay!). You can install FacilityLocationProblems through the Julia package manager. Open Julia's interactive session (REPL) and type:

] add FacilityLocationProblems

Related links

Other packages