Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect result #1

Open
kekesh opened this issue Aug 1, 2021 · 1 comment
Open

Incorrect result #1

kekesh opened this issue Aug 1, 2021 · 1 comment

Comments

@kekesh
Copy link

kekesh commented Aug 1, 2021

The best_fit function does not always produce the correct result. Consider the following item list: [0.38, 0.35, 0.06, 0.21, 0.28, 0.57, 0.15]. The Best Fit algorithm should use exactly two bins: (0.38, 0.35, 0.06, 0.21) and (0.28, 0.57, 0.15). However, the code reports three bins being used.

This is likely caused due to a floating-point precision issue.

@mattianeroni
Copy link

Also I don't understand how you can use the remaining capacity as key in the dictionary. What happens if at a certain point two or more bins have the same remaining capacity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants