项目作者: rafaelmartinelli

项目描述 :
Julia Package for reading Capacitated Facility Location Problem data files
高级语言: Julia
项目地址: git://github.com/rafaelmartinelli/CFLPLib.jl.git
创建时间: 2021-05-14T14:54:13Z
项目社区:https://github.com/rafaelmartinelli/CFLPLib.jl

开源协议:MIT License

下载


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:

  1. struct FacilityLocationProblem
  2. name::String # Instance name
  3. capacities::Vector{Int64} # Facilities capacities
  4. demands::Vector{Int64} # Customers demands
  5. fixed_costs::Vector{Float64} # Fixed costs to open facilities
  6. costs::Matrix{Float64} # Costs to assign facilities to customers
  7. lb::Float64 # Lower bound (-Inf if not known)
  8. ub::Float64 # Upper bound ( Inf if not known)
  9. end

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

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

  1. data = loadFacilityLocationProblem(:capa, 8000)

(Capacitated) P-Median Problems

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

  1. struct PMedianProblem
  2. name::String # Instance name
  3. medians::Int64 # Number of medians (p)
  4. capacity::Int64 # Medians capacities
  5. demands::Vector{Int64} # Customers demands
  6. costs::Matrix{Float64} # Costs matrix (distances)
  7. x::Vector{Int64} # Customers x coordinates
  8. y::Vector{Int64} # Customers y coordinates
  9. lb::Float64 # Lower bound (-Inf if not known)
  10. ub::Float64 # Upper bound ( Inf if not known)
  11. end

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

  1. 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:

  1. struct MaximumCoverageProblem
  2. name::String # Instance name
  3. medians::Int64 # Number of medians (p)
  4. distance::Int64 # Coverage distance
  5. demands::Vector{Int64} # Customers demands
  6. coverage::Vector{Vector{Int64}} # Coverage sets
  7. x::Vector{Int64} # Customers x coordinates
  8. y::Vector{Int64} # Customers y coordinates
  9. lb::Float64 # Lower bound (-Inf if not known)
  10. ub::Float64 # Upper bound ( Inf if not known)
  11. 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:

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

  1. 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:

  1. ] add FacilityLocationProblems

Other packages