Approximation, Parameterized and Heuristic AlgorithmsIntroductionMany important optimization problems are computationally difficult. In complexity theory, problems such as Travelling Salesperson, Knapsack, Set Cover, Maximum Satisfiability and graph coloring are commonly associated with NP-hardness. For such problems, an exact algorithm may require exponential time unless a major unresolved complexity-theoretic conjecture is false. Yet practical systems still need good solutions, often within seconds or minutes and sometimes for instances containing millions of variables. This chapter studies algorithmic strategies that respond to this tension. Approximation algorithms provide provable bounds on solution quality. Parameterized algorithms identify a small structural parameter that controls exponential effort. Local search and metaheuristics seek high-quality solutions through controlled exploration. Branch-and-bound combines systematic enumeration with mathematical bounds. Intelligent search uses problem structure, learning and adaptive control to guide computation. These methods are not interchangeable. Approximation emphasizes worst-case guarantees; parameterized complexity emphasizes dependence on structure; exact exponential methods emphasize pruning; heuristics emphasize practical solution quality. Advanced algorithm design requires selecting, combining and evaluating these perspectives rather than treating any one method as universally superior. Learning ObjectivesBy the end of this chapter, the reader should be able to: - Explain why approximation, parameterized and heuristic methods are needed for difficult optimization problems.
- Construct and analyze approximation algorithms using approximation ratios and performance guarantees.
- Distinguish approximation algorithms, approximation schemes and parameterized algorithms.
- Formulate fixed-parameter tractable algorithms and reason about kernelization.
- Design local-search, branch-and-bound and metaheuristic procedures.
- Evaluate algorithms using quality, runtime, scalability, robustness and reproducibility.
- Select an appropriate method for an AI/ML or operations-optimization application.
1. Computational Difficulty and the Design SpaceAn optimization problem can be represented by a set of feasible solutions F and an objective function f. For a minimization problem, the goal is to find x ∈ F such that f(x) is as small as possible. For a maximization problem, f(x*) is as large as possible. The feasible set may be defined by constraints, logical conditions, graph structure or a learned predictive model. A polynomial-time exact algorithm is generally preferred, but it may be unavailable for NP-hard problems. The practical design space then includes: - sacrificing optimality while retaining a theorem about solution quality;
- exploiting a small parameter such as solution size or treewidth;
- enumerating intelligently while pruning impossible or inferior branches;
- searching promising neighborhoods rather than the entire solution space;
- combining several methods in a hybrid algorithm.
The relevant performance dimensions are not only runtime and objective value. A professional evaluation should also consider memory, parallelizability, sensitivity to input order, stability across random seeds, constraint violations, explainability and the cost of obtaining a feasible solution. 2. Approximation Algorithms2.1 Approximation ratioLet OPT(I) denote the optimal objective value for instance I, and let A(I) be the value returned by algorithm A. For a minimization problem, A is a ρ-approximation if A(I) ≤ ρ · OPT(I), ρ ≥ 1 For a maximization problem, A is a ρ-approximation if A(I) ≥ OPT(I) / ρ, ρ ≥ 1 The ratio is measured against the optimum, not against another heuristic. A ratio of 1 is exact; larger values are weaker for minimization, while a ratio closer to 1 is stronger for both conventions above. An approximation guarantee is usually worst-case. It does not state that every practical instance will be close to the bound, nor that the algorithm is faster than every competing method. It states that the returned solution cannot be arbitrarily bad relative to optimum under the stated assumptions. 2.2 Greedy design and charging argumentsA common construction pattern is to make a locally attractive choice and then prove its global quality by charging the algorithm's cost to an optimal solution. For example, consider the metric Travelling Salesperson Problem (metric TSP), where distances satisfy non-negativity, symmetry and the triangle inequality. A minimum spanning tree (MST) has cost at most OPT because removing one edge from an optimal tour produces a spanning tree. Doubling every MST edge creates an Eulerian multigraph of cost at most 2OPT. An Euler tour can be shortcut by skipping already visited vertices; the triangle inequality ensures that shortcutting does not increase cost. Therefore, preorder traversal of a doubled MST yields a tour of cost at most 2OPT. The proof illustrates a general pattern: - construct a lower-bound object, here an MST;
- transform it into a feasible structure;
- bound the transformation cost;
- use structural assumptions, here the triangle inequality, to simplify it safely.
Without the triangle inequality, shortcutting can increase cost arbitrarily, so this guarantee does not apply to general TSP. 2.3 Set Cover and logarithmic guaranteesIn Set Cover, a universe U of n elements is given together with subsets S₁, S₂, …, S_m. The task is to select as few subsets as possible whose union is U. The greedy algorithm repeatedly selects the set covering the largest number of currently uncovered elements. Its approximation ratio is at most 1 + ln n, where ln is the natural logarithm. More precisely, the classical harmonic-number bound is H_n = 1 + 1/2 + ⋯ + 1/n ≤ 1 + ln n. This guarantee is meaningful even though the ratio grows slowly with n. It also reflects a deeper limitation: under standard complexity assumptions, Set Cover cannot generally be approximated substantially better than logarithmic order. The greedy rule can be extended to weighted Set Cover by selecting the set with the best ratio of cost to newly covered elements. The proof uses a charging argument in which each newly covered element receives a share of the selected set's cost. 2.4 Approximation schemesAn approximation scheme accepts an accuracy parameter ε > 0. A polynomial-time approximation scheme (PTAS) for a minimization problem produces a solution satisfying A(I) ≤ (1 + ε) · OPT(I) for every fixed ε > 0, with polynomial runtime in the input size for that fixed ε. The degree of the polynomial may depend on 1/ε. A fully polynomial-time approximation scheme (FPTAS) is stronger: runtime is polynomial in both input size and 1/ε. For example, the 0/1 Knapsack problem has an FPTAS based on scaling item values. If item values are nonnegative integers v_i and the largest value is V_max, values can be rounded or scaled so that the dynamic program becomes smaller. The resulting solution can be made within a factor 1 − ε of optimum for maximization, with runtime polynomial in n and 1/ε. The exact scaling details must account for the chosen rounding convention; careless scaling can invalidate the guarantee. PTAS and FPTAS are different from fixed-parameter tractability. In a scheme, ε controls accuracy and computational cost. In parameterized complexity, a parameter k describes structural difficulty. 3. Parameterized Algorithms3.1 The parameterized viewpointA parameterized problem has input size n and parameter k. An algorithm is fixed-parameter tractable (FPT) if its runtime has the form f(k) · nc where f is any computable function, c is a constant independent of k and n, and the polynomial factor is independent of k. Exponential dependence on a small k may be acceptable; exponential dependence on n usually is not. For Vertex Cover, k is the desired cover size. The decision problem asks whether a graph G=(V,E) has a vertex cover of size at most k. A simple branching algorithm selects an edge (u,v). Any cover must contain u or v, so the algorithm branches on these two choices and reduces k by one in each branch. Its recurrence is T(k) ≤ 2T(k − 1) + O(n) which gives T(k)=O(2^k · n) under a straightforward implementation. The method is practical when k is small even if the graph itself is large. 3.2 KernelizationKernelization preprocesses an instance in polynomial time to produce an equivalent instance whose size is bounded by a function of k. The reduced instance is called a kernel. Equivalence means that the original instance is a yes-instance exactly when the reduced instance is a yes-instance, and a solution can usually be reconstructed. For Vertex Cover, if a vertex has degree greater than k, every cover of size at most k must include that vertex: otherwise all its neighbors would need to be selected, requiring more than k vertices. Selecting that vertex and reducing k is therefore safe. Other reduction rules remove isolated vertices and simplify forced choices. A problem is FPT if and only if it admits a kernelization procedure under standard parameterized-complexity formulations. In practice, kernelization is valuable even when a theoretical kernel is not the main algorithm, because preprocessing reduces memory, branching and feature dimensionality. 3.3 Parameter choice and structural insightA poor parameter can make an FPT algorithm unusable. Common parameters include solution size, treewidth, feedback-vertex-set size, number of machine types, maximum degree and number of exceptional constraints. A useful parameter should be: - small on the intended application distribution;
- computable or estimable efficiently;
- structurally related to the source of difficulty;
- meaningful to stakeholders.
Parameterized analysis can also reveal that a problem is fixed-parameter tractable for one parameter but W[1]-hard for another. Such results guide algorithm selection and prevent unjustified claims that “small parameter” alone guarantees tractability. 4. Branch-and-BoundBranch-and-bound is an exact search framework. It recursively partitions the feasible region into subproblems, computes an upper or lower bound for each subproblem, and prunes a subproblem when it cannot improve the incumbent solution. For a maximization problem, let UB(P) be an upper bound on the best value obtainable in subproblem P. If the incumbent value is z, then P can be discarded when UB(P) ≤ z. For minimization, a lower bound LB(P) permits pruning when LB(P) ≥ z. Correct pruning requires valid bounds; an optimistic upper bound for maximization or optimistic lower bound for minimization must never exclude a potentially optimal solution. A generic maximization scheme is: - obtain a feasible incumbent, often through a heuristic;
- choose an unresolved subproblem;
- compute its bound;
- prune if the bound cannot beat the incumbent;
- otherwise branch into smaller subproblems;
- update the incumbent whenever a better feasible solution is found.
Branching strategy affects runtime dramatically. Good rules often branch on a variable with high constraint impact, while good node ordering explores promising branches first. A strong incumbent increases pruning, and a strong bound reduces the number of surviving nodes. Integer programming solvers implement this idea through branch-and-bound, cutting planes, presolve and increasingly sophisticated branching rules. 5. Local SearchLocal search begins with a feasible solution and repeatedly applies an improving move from a defined neighborhood. If N(x) is the neighborhood of solution x, a local optimum for maximization satisfies f(x) ≥ f(y) for every y ∈ N(x) The neighborhood is part of the algorithm's model of “nearby.” In TSP, a 2-opt move removes two tour edges and reconnects the paths in the alternative way. In scheduling, a move may swap two jobs or move one job to another machine. In clustering, a move may reassign one observation or exchange representatives. First-improvement accepts the first improving neighbor found; best-improvement evaluates all available moves and selects the best. First-improvement may be faster per iteration, while best-improvement can reduce the number of iterations. Neither dominates universally. Local optima, plateaus and cycling are central difficulties. Common responses include random restarts, allowing non-improving moves, changing neighborhoods and maintaining tabu restrictions. A neighborhood must preserve feasibility or provide a principled repair mechanism; otherwise objective improvements may be meaningless because constraints are violated. 6. Metaheuristics and Intelligent SearchA metaheuristic is a general strategy for guiding heuristic search across problem instances. It normally contains a representation, an objective or fitness function, a move or variation operator, an acceptance rule and a termination condition. Simulated annealingSimulated annealing sometimes accepts a worse move to escape local optima. For a minimization problem, a move with objective increase Δ > 0 may be accepted with probability p = exp(−Δ / T) where T > 0 is the current temperature. A random number r uniformly distributed on [0,1] is generated, and the move is accepted if r ≤ p. As T decreases according to a cooling schedule, the search becomes less exploratory. The formula assumes a consistent objective scale; if costs are extremely large or differently normalized, the temperature schedule must be adjusted. Tabu searchTabu search records recently performed moves or solution attributes in a tabu list. A tabu move is temporarily forbidden unless an aspiration criterion applies, such as producing a solution better than the best known solution. Tabu tenure controls memory length. Short tenure may permit cycling; excessive tenure can block useful regions. Evolutionary algorithmsEvolutionary algorithms maintain a population of candidate solutions. Selection favors high fitness, while crossover and mutation generate new candidates. Their effectiveness depends strongly on representation. A permutation representation is appropriate for tours, whereas a binary representation may be appropriate for feature selection. Infeasible offspring require repair, penalty functions or constraint-aware operators. Ant colony and swarm methodsAnt colony optimization constructs solutions using pheromone trails and heuristic desirability. Pheromone evaporation prevents unlimited accumulation of early choices. Particle swarm optimization represents candidates as particles whose positions are influenced by personal and collective best positions; it is naturally suited to continuous spaces but requires careful handling of constraints and discrete decisions. Learning-guided searchModern intelligent search may use machine learning to predict promising branches, select neighborhoods, estimate bounds or configure solver parameters. A learned policy should guide, not silently replace, correctness-critical components unless its failure modes are formally controlled. In exact optimization, a learned branching score can be safe if it changes only search order. A learned bound is unsafe unless it is certified as valid or used only as a heuristic incumbent estimator. 7. Worked Example: Branch-and-Bound for 0/1 KnapsackSuppose a knapsack has capacity 10 and items: | Item | Weight | Value |
|---|
| A | 6 | 30 | | B | 3 | 14 | | C | 4 | 16 | | D | 2 | 9 |
Each item is either selected or rejected. The objective is to maximize total value subject to total weight ≤ 10. A fractional-knapsack relaxation provides an upper bound: items may be fractionally included after the current decisions. A feasible solution selecting A and B has weight 9 and value 44, so the incumbent is 44. Consider the branch excluding A. Items B, C and D can all be selected: weight 9 and value 39, so this branch cannot improve the incumbent. For the branch including A, the residual capacity is 4. Selecting C gives weight 10 and value 46, improving the incumbent to 46. The alternative B and D has weight 5 and value 23 in the residual problem, giving total value 53 and weight 11, which is infeasible; B alone gives 44, and C alone gives 46. Thus A+C is a best solution among these combinations with value 46. A fractional bound for a remaining subproblem can prune it if it is no greater than 46. This small example demonstrates the interaction among feasible incumbents, relaxations and pruning; larger instances require careful node ordering and efficient bound computation. 8. Applied Case: AI-Assisted Delivery RoutingBackgroundConsider a regional delivery company serving several thousand daily orders. Each vehicle has a capacity, driver-hour limit and delivery time windows. Travel times vary with traffic, and some customers require priority service. The resulting vehicle-routing problem is a constrained combinatorial optimization problem. ProblemAn exact mixed-integer formulation can become too slow during morning planning, while a purely greedy route may produce excessive travel and late deliveries. The company needs high-quality routes within ten minutes and must retain operational feasibility. Analysis and approachThe system uses a hybrid architecture. A constructive heuristic first creates feasible routes using savings-based insertion and time-window checks. Local search then applies relocate, swap and 2-opt* moves between routes. A tabu mechanism prevents immediate cycling. An exact solver is applied to difficult geographic clusters, using the heuristic solution as an incumbent. A learned model predicts which neighborhood is most promising from features such as route slack, stop density and historical improvement rate. The learned model changes move ordering but does not certify feasibility or optimality. Every accepted route is checked by a deterministic constraint validator. On selected clusters, branch-and-bound supplies lower bounds, allowing the company to report an optimality gap when the search terminates early. For a minimization problem, if a feasible solution has cost z and a valid lower bound is L, the relative gap can be reported as (z − L) / L when L > 0. This quantity is meaningful only when the bound and objective use the same cost definition. OutcomeThe hybrid approach produces feasible plans within the planning deadline, while exact search provides certificates on smaller subproblems. Operational staff can inspect routes and override assignments. The principal benefit is not merely a lower travel distance; it is a controlled balance among cost, service reliability, runtime and explainability. Learning points- Feasibility validation must be independent of a learned heuristic.
- Good incumbents improve exact search through stronger pruning.
- Decomposition can expose small parameters or manageable clusters.
- Report bounds, runtime and failure cases rather than only average objective values.
9. Evaluation, Limitations and GovernanceApproximation guarantees are worst-case and may be loose. Heuristics often perform well empirically but lack universal guarantees. Metaheuristics can be sensitive to random seeds, parameter settings and stopping rules. Branch-and-bound can experience exponential memory or runtime. Parameterized methods may be excellent only when the chosen parameter is genuinely small. A sound experimental protocol should use representative benchmark families, separate training and test instances when learning is involved, report distributions rather than only means, include baselines, disclose hardware and stopping criteria, and perform ablation studies. For stochastic algorithms, confidence intervals or repeated-run summaries are preferable to a single best run. In operational AI, optimization objectives can encode social priorities. A routing objective that minimizes distance alone may disadvantage remote communities or shift difficult work to particular drivers. Constraints involving fairness, safety, accessibility, privacy and labor regulation should be explicit. Sensitive historical data used to learn branching or dispatch policies may reproduce institutional bias. Human override, audit logs and rollback procedures are essential in high-impact settings. 10. Best-Practice Design Workflow- Define the objective, constraints and acceptable violations precisely.
- Determine whether an exact polynomial algorithm exists before using a heuristic.
- Seek relaxations, lower bounds, structural parameters and decomposition opportunities.
- Build a simple feasible baseline before adding sophisticated search.
- Match representation and neighborhoods to the problem structure.
- Use approximation algorithms when a guarantee is valuable and available.
- Use branch-and-bound with strong valid bounds and good incumbents.
- Tune stochastic methods on validation instances, not on the final test set.
- Combine methods only when interfaces preserve feasibility and interpretability.
- Report quality, runtime, robustness, gaps and limitations transparently.
Chapter SummaryDifficult optimization problems require a portfolio of algorithmic ideas. Approximation algorithms trade exactness for provable quality, with ratios, PTASs and FPTASs offering different forms of control. Parameterized algorithms exploit a small structural parameter, while kernelization reduces instances before expensive computation. Branch-and-bound obtains exact answers through valid bounds, branching and pruning. Local search explores neighborhoods; simulated annealing, tabu search, evolutionary methods and swarm approaches provide broader exploration. Learning can improve ordering and configuration, but correctness-critical feasibility and bounds require independent validation. The central design principle is alignment: the guarantee, parameter, neighborhood, bound or learned signal must match the structure and risks of the application. Evaluation must include more than objective value, incorporating runtime, reliability, reproducibility, fairness and governance. Key TermsApproximation ratio: Worst-case comparison between an algorithm's solution and the optimum. Approximation scheme: Algorithm whose accuracy is controlled by parameter ε. Branch-and-bound: Exact search using branching and valid bounds to prune subproblems. Cooling schedule: Rule controlling temperature reduction in simulated annealing. FPT: Fixed-parameter tractable runtime of the form f(k)·n^c. Heuristic: Method designed to find good solutions without a universal optimality guarantee. Incumbent: Best feasible solution currently known during search. Kernelization: Polynomial preprocessing that produces an equivalent instance bounded by a function of a parameter. Local optimum: Solution with no improving solution in its chosen neighborhood. Metaheuristic: General strategy for guiding heuristic search. Neighborhood: Set of solutions reachable by an allowed local move. Optimality gap: Difference between a feasible objective and a valid bound on the optimum. Parameter: Structural quantity controlling the difficult part of a parameterized problem. PTAS: Polynomial-time approximation scheme for each fixed accuracy value. Pruning: Discarding a search subproblem that cannot improve the incumbent. Relaxation: Problem obtained by weakening constraints to derive a bound. Tabu search: Local search using memory to discourage cycling. Valid bound: Bound that cannot incorrectly exclude an optimal solution. Review QuestionsShort Answer Questions- What is the approximation guarantee for a minimization algorithm returning value A(I) when the optimum is OPT(I)?
- Define fixed-parameter tractability and identify the role of parameter k.
- Why is the triangle inequality essential in the MST-based 2-approximation for metric TSP?
- What is the purpose of an incumbent in branch-and-bound?
- State one difference between first-improvement and best-improvement local search.
Long Answer Questions- Explain approximation ratios, PTASs and FPTASs, and compare the guarantees and runtime implications of each.
- Derive the branching recurrence for the basic Vertex Cover algorithm and explain why each branch is exhaustive.
- Describe how bounds, branching order and incumbents interact in branch-and-bound.
- Compare simulated annealing, tabu search and evolutionary algorithms in terms of exploration, memory and parameter control.
- Design an evaluation protocol for a stochastic optimization algorithm used in production.
Analytical / Application Questions- Design a hybrid approximation and local-search algorithm for a capacitated routing problem. Specify its representation, neighborhood, feasibility mechanism and stopping rule.
- A minimization solver returns cost 1,250 and a valid lower bound of 1,000. Compute the relative optimality gap and explain what the result does and does not prove.
- For a graph problem, propose two possible parameters, explain which is likely to support an FPT approach, and justify your choice using the expected structure of real instances.
Multiple Choice Questions with AnswersQuestion 1For a minimization problem, which condition defines a ρ-approximation? A. A(I) ≥ ρ·OPT(I) B. A(I) ≤ ρ·OPT(I), with ρ ≥ 1 C. A(I) = OPT(I) − ρ D. A(I) ≤ OPT(I)/ρ, with ρ ≥ 1 Correct Answer: B. A(I) ≤ ρ·OPT(I), with ρ ≥ 1 Question 2What is the defining runtime form of an FPT algorithm? A. n^k B. 2^n·k C. f(k)·n^c D. k·log n Correct Answer: C. f(k)·n^c Question 3Which assumption enables shortcutting in the MST-based 2-approximation for metric TSP without increasing tour cost? A. Graph completeness only B. The triangle inequality C. All edges having equal weight D. The graph being acyclic Correct Answer: B. The triangle inequality Question 4In maximization branch-and-bound, when may a subproblem with upper bound UB be pruned? A. When UB is greater than the incumbent B. When UB equals zero only C. When UB is no greater than the incumbent D. Whenever the subproblem has two branches Correct Answer: C. When UB is no greater than the incumbent Question 5Which statement about a PTAS is correct? A. Its runtime must be polynomial in n and 1/ε B. For every fixed ε, it runs in polynomial time in input size C. It always returns an exact optimum D. It is defined only for maximization problems Correct Answer: B. For every fixed ε, it runs in polynomial time in input size Question 6In simulated annealing for minimization, what happens to acceptance probability for a fixed worsening Δ > 0 as temperature T decreases? A. It increases to 1 B. It remains exactly constant C. It decreases D. It becomes negative Correct Answer: C. It decreases Question 7What is the main purpose of kernelization? A. To convert every problem into a polynomial-time problem B. To produce an equivalent smaller instance bounded by a function of k C. To remove the objective function D. To guarantee a 1-approximation Correct Answer: B. To produce an equivalent smaller instance bounded by a function of k Question 8A minimization algorithm returns cost 1250 and a valid lower bound is 1000. What is the relative gap (z−L)/L? A. 0.025 B. 0.25 C. 1.25 D. 250 Correct Answer: B. 0.25 Question 9Which feature most directly helps branch-and-bound prune more nodes? A. A weaker bound B. A poorer incumbent C. A stronger valid bound D. Randomly disabling feasibility checks Correct Answer: C. A stronger valid bound Question 10What is a central risk when a learned model supplies an uncertified bound in an exact optimization algorithm? A. The search may become deterministic B. The model may incorrectly prune an optimal solution C. The input size becomes zero D. The objective automatically becomes convex Correct Answer: B. The model may incorrectly prune an optimal solution
|