0
$\begingroup$

I am practicing for an exam and one of the exercises is:

Find an example sequence where FFD (offline) performs better than BFD (offline).

Intuitively I would say no such sequence exists as the sequence is sorted, but I have not managed to find a counterexample or proof.

$\endgroup$
1
  • 12
    $\begingroup$ FFD? BFD? More context would probably be helpful. $\endgroup$ Jan 17, 2017 at 17:44

1 Answer 1

2
$\begingroup$

Isn't First/Best Fit Decreasing always considered offline (requiring sorting the input assumed unsorted)?
Anyway, let me assume "performs better" to mean uses less bins.
I find it annoyingly hard to try to find an example using a minimum number of items, of item values and minimum item values - and to argue convincingly that it is minimal, but

try a bin size of 16 and items of 11, 6, 6, 3, 2, 2, 2. Bin contents after adding each item:
- FF: 11 11,6 11,12 14,12 16,12 16,14 16,16
- BF: 11 11,6 11,12 11,15 13,15 15,15 15,15,2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.