Directly scanning all edges to evaluate each child of each of choices takes elementary operations, in Big O notation. There is a faster implementation. When assigning vertex , let and count its already assigned graph neighbours labelled zero and one. Contributions from edges not incident to are unchanged, and contributions from edges to unassigned graph neighbours stay for either choice. Therefore
Choose zero if , otherwise one: put on the side with fewer already assigned graph neighbours. With adjacency lists, scanning each vertex's list once costs operations overall and uses storage including the graph. These bounds count operations on labels and counters that fit in machine words of bits. Multiplying the conditional expectation cut formula by two also permits exact integer comparisons without rounding.
If is the size of a maximum cut, then . The constructed cut of a graph thus has size at least , an approximation ratio of in the maximization convention. The five-versus-six example illustrates the gap between this guarantee and exact optimization.
For a general randomized algorithm, the averaging proof alone does not establish efficient derandomization. One needs a polynomial number of commitments, an efficient way to find a suitable child at each step, and manageable representations and evaluation costs for the relevant conditional expectations. Those evaluations can themselves be hard. Enumerating all completions verifies this small example, but would take exponentially many assignments as grows. The polynomial-time algorithm here comes from the local conditional expectation cut formula, not from that enumeration.
When each variable appears in at most one normalized singleton clause, satisfy that favored literal with probability and choose independent variables. Every proper binary clause is then satisfied with probability at least , and every singleton with probability . Maximize the common lower bound by , giving the reciprocal of the golden ratio. The method of conditional probabilities derandomizes the construction, obtaining approximation ratio . Tautologies are harmless; the singleton restriction must be applied after removing repeated literals within clauses.
After removing overweight items and handling free items, compare the feasible density-sorted prefix with the best feasible singleton. The fractional knapsack problem optimum is at most the sum of their profits, so the better solution has approximation ratio .
Heuristic optimization 2026-10-13
Heuristic optimization seeks useful feasible solutions without necessarily providing a universal approximation ratio or a polynomial worst-case guarantee. Examples are local search, simulated annealing and tabu search. A claimed approximation algorithm needs a separate proved performance guarantee.
Metric k-center problem 2026-10-24
The metric k-center problem chooses at most centers from a finite metric space to minimize the largest distance from a point to its nearest center. For , exactly centers gives the same optimum: extra centers never increase the radius. The restriction that centers belong to matters; allowing centers anywhere in an ambient metric space is a different problem.
The basic packing argument is short. If a radius- solution uses centers, its closed balls cover . Two points assigned to the same center have distance at most by the triangle inequality. Thus points with pairwise distances greater than certify that no radius- solution exists. Greedily selecting a new center only outside all existing radius- closed balls therefore uses at most centers whenever a radius- solution exists, and its final covering radius is at most . The farthest-first traversal achieves the same approximation ratio without knowing .
Several other approaches illustrate the range between fast heuristics, certified bounds and approximation schemes.
Sorting weights in decreasing order before greedy assignment avoids the example : it starts with the weight , then places both unit weights in the other bin, giving the optimum. This is a useful scheduling heuristic, although improvement on one example is not a proof of an arbitrary claimed approximation ratio. Local improvement can additionally move a single item or swap items between bins whenever it reduces the maximum load; it produces a local optimum, which need not be global.
A linear-programming relaxation replaces by . The choice for every item gives load in both bins, and summing the load constraints shows that no smaller relaxed value is possible. Together with the indivisibility bound this provides a lower bound on the integer optimum. Any feasible heuristic schedule gives an upper bound . Their ratio is a computable quality certificate. Branch-and-bound can improve these bounds by fixing assignment variables and solving subproblems, although worst-case exact running time need not be polynomial.
For integer weights one can instead solve the problem exactly by dynamic programming. Start with attainable subset sums and update
discarding values above . Let be the largest retained sum. Choosing that subset for one bin gives loads and maximum , which is optimal because every partition has a lighter side of weight at most . The running time is pseudopolynomial: it depends on numeric magnitude, not merely the binary length of .
This exact algorithm also yields rounded dynamic programming for two-bin load balancing. For rational weights and , choose and scaled integer weights . Their total is at most , so exact dynamic programming on them costs arithmetic operations. Let be its optimal scaled maximum load. The original optimal partition is feasible for the scaled problem with load at most , so . When the scaled partition is lifted, each bin contains at most rounding errors, each smaller than . Therefore its original maximum load satisfies
This is a fully polynomial-time approximation scheme: for each requested tolerance it gives a certified feasible solution in time polynomial in the encoded rational input and , with rational arithmetic accounted for. It works here because two-bin balancing has the subset-sum structure; one cannot infer that arbitrary combinatorial optimization problems admit such a scheme.
Represent a feasible allocation by a label for each item saying which bidder receives it. Every such label vector gives disjoint bundles covering all items, so the following heuristic optimization methods can search without violating allocation feasibility.
In local search, begin with any feasible partition and repeatedly make an improving move, such as transferring one item between bidders or exchanging two items. For a transfer , evaluate the change
Stop when no allowed move improves the objective. Several starting partitions can avoid dependence on one local optimum, but no guarantee of a global optimum follows for general bids.
In simulated annealing, use the same feasible neighborhood but also accept a worsening move of loss with probability at temperature . Begin with a relatively high temperature, gradually cool, and retain the best allocation seen. Worsening moves can cross a barrier between local optima; a practical finite cooling schedule does not guarantee optimality.
In tabu search, retain a short memory of recent transfers or exchanges and temporarily prohibit their reversal. Select the best admissible move, possibly worsening the objective, to escape a local optimum. Permit an otherwise tabu move if it improves the best solution found, an aspiration rule. For the winner determination problem, bidder/item pairs or recent reverse transfers provide convenient tabu attributes. All three methods preserve the partition, but for arbitrary bids they are heuristics rather than algorithms with a proved constant approximation ratio.
Use the usual nonempty-clause convention and normalize repeated literals within a clause; tautologies are always satisfied. If empty clauses are admitted, discard them first: they contribute nothing to any assignment or to the optimum. Let be the resulting number of clause occurrences.
Assign independent fair truth values. A singleton clause is satisfied with probability , a proper two-variable clause with probability , and a tautology with probability one. By linearity of expectation, the expected number satisfied is at least , hence at least .
To derandomize, use the method of conditional probabilities. After some variables have been fixed, let be the conditional expected number of satisfied clauses. For the next variable the two conditional expectations satisfy . Fix the value with the larger expectation. This never decreases . When all variables have been fixed, is the actual integer number of satisfied clauses, so
Compute each conditional expectation by summing the probabilities of the clauses. Each has at most two variables, so its contribution is computed in constant time; scanning all clauses for each variable gives arithmetic operations. This is a polynomial-time approximation algorithm with approximation ratio .
Use the usual finite binary encoding of integer or rational input data. NP consists of decision problems whose yes-instances have polynomial-length certificates in computational complexity verifiable in polynomial time. A decision problem is NP-hard if every problem in NP has a polynomial-time many-one reduction to it. It is NP-complete if it is both NP-hard and in NP. An optimization problem is NP-hard when computing its optimum would solve every NP decision problem through a polynomial-time reduction and an optimum-value query; membership in NP applies directly to decision problems, not to an unqualified optimization task.
Reduce subset sum to the 0-1 knapsack problem by setting and . Every feasible value is at most , and the optimum equals exactly when the subset sum answer is yes. The transformation and final comparison take polynomial time. Since subset sum is assumed NP-complete, exact knapsack optimization is NP-hard.
For the half-approximation algorithm for knapsack, use nonnegative weights and profits. Delete overweight items and nonpositive-profit items; take all positive-profit zero-weight items for free. On the remaining positive-weight items, sort decreasing . Take the maximal initial prefix fitting the capacity, and stop at the first item that would overflow. Let be the prefix profit, and let be the largest profit of any individually feasible remaining item. Return the better of the prefix and that singleton, together with the free items. If every item fits, take them all.
The fractional knapsack problem fills exactly that prefix and a fraction of the first excluded item. Its optimum bounds the integer optimum, and without the free items its value is at most . Thus
With total free profit , the same inequality is . This gives an approximation ratio of in sorting time, with polynomial bit complexity for rational data. Nonnegative weights and capacity are the standard knapsack problem assumptions; unrestricted negative weights would not support this argument.
For the quadratic knapsack problem and its fractional row bound for quadratic knapsack, multiply the capacity inequality by the binary and use :
Remove items with first. If , the remaining coordinates are feasible in the fractional problem defining , so . If , that row's contribution is zero. Hence, with ,
The double sum counts each symmetric interaction twice; there is no factor in this problem. Each is a fractional knapsack problem, computable by sorting positive ratios, also handling zero weights separately. This takes polynomial time even when some interactions are negative, because an optional fractional item with negative profit is omitted.
The resulting 0-1 knapsack problem need not be solved exactly. Relax its capacity constraint with a Lagrange multiplier . Its Lagrangian knapsack bound is
For feasible , adding only increases its objective, and maximizing over independent binary choices produces the displayed expression. It is a convex piecewise-linear function with breakpoints at positive . Evaluate those breakpoints and zero, or use the fractional knapsack problem ordering; the best bound is computable in polynomial time. Thus computing all and one additional Lagrangian relaxation gives the requested upper bound.
For the numerical example, the problem has capacity and item ratios and . Select and . This gives
An exchange argument justifies optimality: capacity used on the lower-ratio item can be transferred to the higher-ratio item until the latter is full. The stated and similarly follow from residual capacities and . Therefore , with ratios . The fractional solution takes items and one-third of item , yielding . At the Lagrangian knapsack bound gives the same value:
The fractional solution attaining proves that this is the best bound from this auxiliary Lagrangian relaxation, though it need not be the exact quadratic optimum.
For branch and bound, branch on whether an unresolved is zero or one. If the selected set is , subtract its weight from the residual capacity and retain its exact objective as a constant. For each remaining item replace by , preserving the original interactions between remaining items. Recompute the fractional row bounds and the Lagrangian knapsack bound for that residual problem. Maintain an incumbent from genuine feasible binary solutions evaluated with the quadratic objective; prune infeasible nodes and nodes whose bound is no better than the incumbent. For example, selecting items gives the feasible value . A finite binary branching tree eventually certifies the optimum, but worst-case running time is exponential, as expected for an NP-hard problem.