Packing Problems

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:12 AM on 9/29/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

7 Terms

1
New cards

Partition Problem

The problem is NP-complete (both determining if there are equally sized heaps and finding the two heaps with the smallest difference).

Can be regarded as a special case of Job Scheduling.

Go through the numbers in S, always assign the current number to the heapS1 or S2 that is currently smaller.

Greedy Algorithm 1 provides a 2-approximation, i.e., sum ofs∈S1 s is at most twice as large as it would be in the optimal partition.

<p>The problem is NP-complete (both determining if there are equally sized heaps and finding the two heaps with the smallest difference).</p><p>Can be regarded as a special case of Job Scheduling.</p><p>Go through the numbers in S, always assign the current number to the heapS1 or S2 that is currently smaller.</p><p>Greedy Algorithm 1 provides a 2-approximation, i.e., sum ofs∈S1 s is at most twice as large as it would be in the optimal partition.</p>
2
New cards

Partition prob greedy algo 2

Sort the numbers in S in descending order.

Go through the numbers in S, always assign the current number to the heap S1 or S2 that is currently smaller.

Greedy Algorithm 2 provides a 6/5-approximation.

3
New cards

Subset Sum

O(nZ) pseudo-polynomial

<p>O(nZ) pseudo-polynomial</p>
4
New cards

Knapsack Problem

FORMAL DEFINITION

Given n items gi, each with price pi and weight wi, as well as weight limit W.

Find subset M of items with summation g∈M w(g) ≤ W and summationg∈M p(g) maximal.

Subset Sum is a special case with W = Z, w(s) = s and p(s) = s.


<p>FORMAL DEFINITION</p><p>Given n items gi, each with price pi and weight wi, as well as weight limit W.</p><p>Find subset M of items with summation g∈M w(g) ≤ W and summationg∈M p(g) maximal.</p><p>Subset Sum is a special case with W = Z, w(s) = s and p(s) = s.</p><p></p>
5
New cards

Greedy Knapsack 2

knowt flashcard image
6
New cards

Bin Packing

In Bin Packing, we want to use as few containers as possible to pack all items with a certain volume.

Bin Packing can also be considered in multidimensional space, but we limit ourselves to 1D here.

DEFINITION: Given are containers (bins) with volume V , and n items with volumes v1, . . . , vn. How many bins are minimally necessary to store all items in bins?


7
New cards

First Fit ALGO

Consider items in any order. For each item, go through the existing bins. Place it in the first bin with enough space. If no such bin exists, create a new bin and insert the item there.

First Fit provides a 2-approximation.