I. Orientation — Near-Optimal Solutions with Provable Guarantees
Approximation algorithms are polynomial-time methods for optimization problems where finding an exact optimum is computationally infeasible, commonly because the problem is NP-hard. Rather than merely returning a plausible answer, an approximation algorithm supplies a mathematical guarantee comparing its solution with the unknown optimum.
- Optimization problem: Each valid input has a set of feasible solutions and an objective value to minimize or maximize.
- Optimal value: denotes the objective value of the best feasible solution for instance .
- Polynomial running time: An approximation algorithm must run in time polynomial in the encoded input size, such as for jobs or items.
- Feasibility: The returned solution must satisfy every constraint; closeness to optimality does not excuse an invalid solution.
- Approximation guarantee: A proven bound limits the worst-case difference between the algorithm’s value and .
- Problem direction:
- For minimization, smaller objective values are better.
- For maximization, larger objective values are better.
- Common design principles: Greedy selection, ordering, relaxation, rounding, lower bounds, and local improvement are used to obtain efficient solutions.
- Central trade-off: Better solution quality may require additional computation, while faster algorithms may have weaker guarantees.
II. Approximation Basics — Measuring and Designing Near-Optimal Algorithms
A. Approximation basics
Approximation analysis establishes how close a polynomial-time algorithm’s result is to the exact optimum on every valid input.
-
Minimization ratio: If an algorithm produces value , it is an -approximation when
TextOPT(I) ≤ A(I) ≤ α · OPT(I)
where is the input instance, is the algorithm’s objective value, is the minimum possible value, and . -
Maximization ratio: For a maximization problem, the guarantee is
TextOPT(I) / α ≤ A(I) ≤ OPT(I)
because no feasible solution can exceed the maximum . -
Relative error form: A -approximation for minimization satisfies
TextA(I) ≤ (1 + ε) · OPT(I)
where is the permitted relative error. For example, permits a value at most above optimum. -
Absolute versus asymptotic guarantees:
- Absolute ratio: The bound applies directly to every instance, including small ones.
- Asymptotic ratio: A constant additive term is permitted:
TextA(I) ≤ α · OPT(I) + β
where is the asymptotic approximation ratio and is a fixed constant independent of the input size.
-
Lower and upper bounds: Approximation proofs compare the output against a bound that is easier to compute than the optimum.
- In minimization, a lower bound helps prove .
- In maximization, an upper bound plays the corresponding role.
-
Worked example: Suppose a minimization algorithm returns a solution of cost , while a valid argument proves . Then
TextA(I) / OPT(I) ≤ 120 / 100 = 1.2
so this instance has a certified ratio of at most , even though the exact optimum is unknown. -
Approximation scheme:
- A polynomial-time approximation scheme (PTAS) gives a -approximation for every fixed , with polynomial running time in input size.
- A fully polynomial-time approximation scheme (FPTAS) is polynomial in both input size and .
- A PTAS may become impractical when is small because its exponent can depend on .
B. Design and limitations
An approximation guarantee is a worst-case theorem, not a claim that every returned solution reaches that bound.
- Greedy construction: A locally attractive choice is repeatedly made, as when assigning the next job to the least-loaded machine.
- Relaxation and rounding: Constraints such as integrality are temporarily weakened, the relaxed problem is solved, and fractional values are converted into a feasible discrete solution.
- Charging argument: Parts of the approximate solution’s cost are assigned to components of an optimal solution to show that each optimal component is charged at most times.
- Worst-case interpretation: A 2-approximation may often be optimal in practice; the factor 2 only limits how poor it can be on adversarial instances.
- No universal method: Approximation ratios are problem-specific. An argument valid for scheduling cannot automatically establish a bin-packing bound.
- Hardness barrier: Some NP-hard problems cannot be approximated within particular factors in polynomial time unless standard complexity assumptions, such as , fail.
III. Task Scheduling — Balancing Work Across Identical Machines
A. Task scheduling
Task scheduling assigns independent jobs to machines so that the completion time of the last machine, called the makespan, is minimized.
-
Problem model: For jobs and identical parallel machines, job has processing time , and each job must be assigned wholly to one machine.
-
Machine load: If is the set of jobs assigned to machine , its load is
TextL_i = Σ(j ∈ S_i) p_j
where is machine ’s completion time and is its assigned job set. -
Objective: The makespan is
TextCmax = max(1 ≤ i ≤ m) L_i
where is the latest machine completion time. The goal is to minimize . -
Fundamental lower bounds:
TextOPT ≥ (Σ(j=1 to n) p_j) / m OPT ≥ max(1 ≤ j ≤ n) p_j
The first bound follows from average load; the second follows because the longest job must run somewhere. -
List scheduling algorithm: Process jobs in a given order and assign each one to a currently least-loaded machine.
Textinitialize load[i] = 0 for each machine i for each job j in list order: choose i with minimum load[i] assign job j to machine i load[i] = load[i] + p[j] return maximum load
Here,load[i]is machine ’s assigned processing time andp[j]is job ’s processing time. -
List-scheduling guarantee: For identical machines,
TextCmax ≤ (2 - 1/m) · OPT
because the machine receiving the final job previously had load no greater than the average assigned load. -
Longest Processing Time first: LPT sorts jobs in non-increasing processing-time order before applying list scheduling. Its stronger guarantee is
TextCmax ≤ (4/3 - 1/(3m)) · OPT
for . -
Worked example: For two machines and job times , LPT produces loads:
- Machine 1: .
- Machine 2: .
The makespan is . Since total work is , every schedule has makespan at least ; therefore this schedule is optimal.
B. Applications and limitations
Approximate scheduling is useful when rapid load balancing matters more than the expensive search for an exact partition.
- Applications: Processor allocation, cloud workloads, manufacturing stations, and batch-processing systems all use makespan as a measure of completion speed.
- Efficiency: With a priority queue of machine loads, list scheduling takes ; LPT additionally sorts jobs, giving .
- Tie handling: Any least-loaded machine may be selected when loads tie; the approximation guarantee remains valid.
- Model limitations: The stated bounds assume identical machines, independent jobs, no preemption, and known processing times.
- Extended constraints: Deadlines, precedence relations, release times, communication costs, or unrelated machine speeds require different algorithms and analyses.
IV. Bin Packing — Minimizing the Number of Fixed-Capacity Containers
A. Bin packing
Bin packing places indivisible items into the fewest equal-capacity bins without exceeding any bin’s capacity.
-
Problem model: Given item sizes and bin capacity , each item satisfies .
-
Feasibility condition: For every bin ,
TextΣ(j assigned to bin k) s_j ≤ B
where is item ’s size and is bin capacity. -
Objective: Minimize the number of nonempty bins. A basic lower bound is
TextOPT ≥ ceil((Σ(j=1 to n) s_j) / B)
because the total item size must fit within the total capacity of all used bins. -
Next Fit: Keep only one bin open; place the next item there if it fits, otherwise close that bin and open another.
- Time: .
- Guarantee: Next Fit uses at most bins.
-
First Fit: Scan existing bins in creation order and place each item in the first bin with sufficient remaining capacity; open a new bin if none works.
- Time: in a direct implementation.
- Guarantee: Its asymptotic approximation ratio is .
-
Best Fit: Place each item in a feasible bin that leaves the least remaining capacity, attempting to fill bins tightly.
-
First Fit Decreasing: Sort items in non-increasing size order, then apply First Fit.
- Time: Common implementations run in .
- Bound:
TextFFD(I) ≤ (11/9) · OPT(I) + 6/9
where is the number of bins used on instance .
-
Worked example: With and item sizes , First Fit Decreasing packs , , and , using three bins. Since the total size is , the lower bound is , proving optimality.
B. Applications and limitations
Bin-packing heuristics convert capacity constraints into fast placements, but their success depends strongly on item order and size distribution.
- Applications: Memory allocation, disk storage, cargo loading, cutting stock, and virtual-machine placement can be modeled using bins and capacities.
- Online versus offline methods:
- Online: Next Fit and unsorted First Fit can process items as they arrive without seeing future items.
- Offline: First Fit Decreasing requires all sizes in advance but gains a stronger guarantee through sorting.
- Fragmentation: Unused capacity may be spread across several bins even when its total is large enough for another item.
- Order sensitivity: First Fit and Best Fit can produce different packings for different input orders; decreasing-order variants reduce this effect.
- Lower-bound limitation: The total-size bound may be weak because it ignores incompatibility among large items, such as several items each exceeding .
- Model limitation: Classical bin packing uses one capacity dimension; multidimensional packing with weight, volume, or memory constraints requires separate approximation techniques.
Nearly through. Did unit 12 of ECAP538 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 12 of ECAP538 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill; the rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks.