nextkfit

package
v0.0.0-...-80c8c53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NextKFit

type NextKFit struct {
	K int
}

NextKFit is an optimizer that implements the next-k-fit algorithm expanded to solve the bin packing problem with heterogeneous bins and items with different sizes that depend on the bin choice. K parameter defines the number of open bins on which the first-fit algorithm is performed. If any of the bins within the K range is not suitable for the item, the algorithm consecutively tries to put the item inside the next bins, simultaneously moving the open bins' range borders. If K is equal to 1, the algorithm behaves like NextFit. If K is equal to n (the number of bins), the algorithm behaves like a FirstFit.

func (NextKFit) Optimize

func (nkf NextKFit) Optimize(ctx context.Context, data *data.Data) (*optimizer.Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL