Skip to content

Julia Package for reading Bin Packing Problem's and Cutting Stock Problem's data files

License

Notifications You must be signed in to change notification settings

rafaelmartinelli/BPPLib.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BPPLib.jl

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

This package reads .txt data files in bpp format for Bin Packing Problem (BPP) instances and returns BPPData type:

struct BPPData
    name     ::String        # Instance name
    capacity ::Int64         # Bin capacity
    weights  ::Vector{Int64} # Items' weights

    lb       ::Int64         # Lower bound (0 if not known)
    ub       ::Int64         # Upper bound (typemax(Int64) if not known)
end

It also reads .txt data files in csp format for Cutting Stock Problem (CSP) instances and returns CSPData type:

struct CSPData
    name     ::String        # Instance name
    capacity ::Int64         # Bin capacity
    weights  ::Vector{Int64} # Items' weights
    demands  ::Vector{Int64} # Items' demands

    lb       ::Int64         # Lower bound (0 if not known)
    ub       ::Int64         # Upper bound (typemax(Int64) if not known)
end

To install:

] add https://github.com/rafaelmartinelli/BPPLib.jl

For example, to load BPP instance Falkenauer_u120_00.txt:

data = loadBPP("/path/to/BPP/instance/Falkenauer_u120_00.txt")

To load CSP instance Falkenauer_u120_00.txt:

data = loadCSP("/path/to/CSP/instance/Falkenauer_u120_00.txt")

You can find the classical BPP and CSP instances from the literature in the BPPLib website.

Since there are more than 2000 instances in the literature, this package includes only 50 small randomly generated instances. For example, to load BPP instance PM_u010_01.txt:

data = loadBPP(:PM_u010_01)

Or to load CSP instance PM_u010_01.txt:

data = loadCSP(:PM_u010_01)

See the full list.

Related links: