{"id":28936394,"url":"https://github.com/rafaelmartinelli/facilitylocationproblems.jl","last_synced_at":"2025-08-09T22:12:36.274Z","repository":{"id":38326959,"uuid":"367395092","full_name":"rafaelmartinelli/FacilityLocationProblems.jl","owner":"rafaelmartinelli","description":"Julia Package for reading location problems data files","archived":false,"fork":false,"pushed_at":"2023-05-17T16:04:51.000Z","size":2009,"stargazers_count":14,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T20:09:26.227Z","etag":null,"topics":["cflp","facility-location","julia","location","maximum-coverage","maximum-covering-problems","optimization","p-median"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafaelmartinelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-14T14:54:13.000Z","updated_at":"2025-05-29T18:10:49.000Z","dependencies_parsed_at":"2022-08-24T05:41:03.588Z","dependency_job_id":null,"html_url":"https://github.com/rafaelmartinelli/FacilityLocationProblems.jl","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rafaelmartinelli/FacilityLocationProblems.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmartinelli%2FFacilityLocationProblems.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmartinelli%2FFacilityLocationProblems.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmartinelli%2FFacilityLocationProblems.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmartinelli%2FFacilityLocationProblems.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaelmartinelli","download_url":"https://codeload.github.com/rafaelmartinelli/FacilityLocationProblems.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmartinelli%2FFacilityLocationProblems.jl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269646015,"owners_count":24452845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cflp","facility-location","julia","location","maximum-coverage","maximum-covering-problems","optimization","p-median"],"created_at":"2025-06-22T20:09:20.480Z","updated_at":"2025-08-09T22:12:36.266Z","avatar_url":"https://github.com/rafaelmartinelli.png","language":"Julia","readme":"# FacilityLocationProblems.jl\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://rafaelmartinelli.github.io/FacilityLocationProblems.jl/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://rafaelmartinelli.github.io/FacilityLocationProblems.jl/dev)\n[![Build Status](https://github.com/rafaelmartinelli/FacilityLocationProblems.jl/workflows/CI/badge.svg)](https://github.com/rafaelmartinelli/FacilityLocationProblems.jl/actions)\n[![Coverage](https://codecov.io/gh/rafaelmartinelli/FacilityLocationProblems.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/rafaelmartinelli/FacilityLocationProblems.jl)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n\nThis package reads data files for different location problems instances:\n\n- (Capacitated) Facility Location Problems\n- ~~(~~Capacitated~~)~~ P-Median Problems\n- Maximum Coverage Problems\n\n## Usage\n\n### Capacitated Facility Location Problems\n\nThe type used by (Capacitated) Facility Location Problems is `FacilityLocationProblem`, defined as follows:\n\n```julia\nstruct FacilityLocationProblem\n    name::String                 # Instance name\n\n    capacities::Vector{Int64}    # Facilities capacities\n    demands::Vector{Int64}       # Customers demands\n    fixed_costs::Vector{Float64} # Fixed costs to open facilities\n    costs::Matrix{Float64}       # Costs to assign facilities to customers\n\n    lb::Float64                  # Lower bound (-Inf if not known)\n    ub::Float64                  # Upper bound ( Inf if not known)\nend\n```\n\nSome classical instances from the literature can be downloaded on demand from [ORLib page](http://people.brunel.ac.uk/~mastjjb/jeb/info.html). For example, to download and load instance `cap41`:\n\n```julia\ndata = loadFacilityLocationProblem(:cap41)\n```\n\nSee the full list on [ORLib UFLP page](http://people.brunel.ac.uk/~mastjjb/jeb/orlib/uncapinfo.html), [ORLib CFLP page](http://people.brunel.ac.uk/~mastjjb/jeb/orlib/capinfo.html) or call the function `getFacilityLocationInstances`.\n\nOptionally, it is possible to set the facilities' capacity (mandatory for instances `capa`, `capb`, and `capc`):\n\n```julia\ndata = loadFacilityLocationProblem(:capa, 8000)\n```\n\n### ~~(~~Capacitated~~)~~ P-Median Problems\n\nThe type used by ~~(~~Capacitated~~)~~ P-Median Problems is `PMedianProblem`, defined as follows:\n\n```julia\nstruct PMedianProblem\n    name::String           # Instance name\n\n    medians::Int64         # Number of medians (p)\n    capacity::Int64        # Medians capacities\n\n    demands::Vector{Int64} # Customers demands\n    costs::Matrix{Float64} # Costs matrix (distances)\n\n    x::Vector{Int64}       # Customers x coordinates\n    y::Vector{Int64}       # Customers y coordinates\n\n    lb::Float64            # Lower bound (-Inf if not known)\n    ub::Float64            # Upper bound ( Inf if not known)\nend\n```\n\nSome classical (Capacitated) P-Median instances from the literature are preloaded. For example, to load instance `pmedcap01`:\n\n```julia\ndata = loadPMedianProblem(:pmedcap01)\n```\n\nSee the [full list](https://github.com/rafaelmartinelli/FacilityLocationProblems.jl/tree/main/data) or call the function `getPMedianInstances`.\n\n### Maximum Coverage Problems\n\nThe type used by Maximum Coverage Problems is `MaximumCoverageProblem`, defined as follows:\n\n```julia\nstruct MaximumCoverageProblem\n    name::String                    # Instance name\n\n    medians::Int64                  # Number of medians (p)\n    distance::Int64                 # Coverage distance\n\n    demands::Vector{Int64}          # Customers demands\n    coverage::Vector{Vector{Int64}} # Coverage sets\n\n    x::Vector{Int64}                # Customers x coordinates\n    y::Vector{Int64}                # Customers y coordinates\n\n    lb::Float64                     # Lower bound (-Inf if not known)\n    ub::Float64                     # Upper bound ( Inf if not known)\nend\n```\n\nThe 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:\n\n```julia\ndata = loadMaximumCoverageProblem(:pmedcap01, 10)\n```\n\nThe medians capacities are ignored, and the coverage sets are built using calculated costs and given coverage distance.\n\n### Other Features\n\nThis package also loads custom instances (following [ORLib format](http://people.brunel.ac.uk/~mastjjb/jeb/info.html)):\n\n```julia\ndata = loadTypeOfProblem(\"/path/to/your/instance.txt\", optional_arguments)\n```\n\n## Installation\n\nFacilityLocationProblems is a registered Julia Package (yay!).\nYou can install FacilityLocationProblems through the Julia package manager.\nOpen Julia's interactive session (REPL) and type:\n\n```julia\n] add FacilityLocationProblems\n```\n\n## Related links\n\n- [ORLib's Uncapacitated Facility Location page](http://people.brunel.ac.uk/~mastjjb/jeb/orlib/uncapinfo.html)\n- [ORLib's Capacitated Facility Location page](http://people.brunel.ac.uk/~mastjjb/jeb/orlib/capinfo.html)\n- [ORLib's Uncapacitated P-Median page](http://people.brunel.ac.uk/~mastjjb/jeb/orlib/pmedinfo.html) (this package does not read those instances)\n- [ORLib's Capacitated P-Median page](http://people.brunel.ac.uk/~mastjjb/jeb/orlib/pmedcapinfo.html)\n- [Sobolev Institute of Mathematics' CFLP Page](http://www.math.nsc.ru/AP/benchmarks/CFLP/cflp_tabl-eng.html) (this package does not read those instances)\n- [Instituto Nacional de Pesquisas Espaciais' P-Median and Max Cover Page](http://www.lac.inpe.br/~lorena/instancias.html) (this package does not read those instances)\n\n## Other packages\n\n- [KnapsackLib.jl](https://github.com/rafaelmartinelli/Knapsacks.jl): Knapsack algorithms in Julia\n- [LotSizingProblems.jl](https://github.com/rafaelmartinelli/LotSizingProblems.jl): Lot Sizing Problems Lib\n- [AssignmentProblems.jl](https://github.com/rafaelmartinelli/AssignmentProblems.jl): Assignment Problems Lib\n- [InventoryRoutingProblems.jl](https://github.com/rafaelmartinelli/InventoryRoutingProblems.jl): Inventory Routing Problems Lib\n- [BPPLib.jl](https://github.com/rafaelmartinelli/BPPLib.jl): Bin Packing and Cutting Stock Problems Lib\n- [CARPData.jl](https://github.com/rafaelmartinelli/CARPData.jl): Capacitated Arc Routing Problem Lib\n- [MDVSP.jl](https://github.com/rafaelmartinelli/MDVSP.jl): Multiple-Depot Vehicle Scheduling Problem Lib\n- [CVRPLIB.jl](https://github.com/chkwon/CVRPLIB.jl): Capacitated Vehicle Routing Problem Lib\n- [TSPLIB.jl](https://github.com/matago/TSPLIB.jl): Traveling Salesman Problem Lib\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelmartinelli%2Ffacilitylocationproblems.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelmartinelli%2Ffacilitylocationproblems.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelmartinelli%2Ffacilitylocationproblems.jl/lists"}