Charging argument

Last updated

In computer science, a charging argument is used to compare the output of an optimization algorithm to an optimal solution. It is typically used to show that an algorithm produces optimal results by proving the existence of a particular injective function. For profit maximization problems, the function can be any one-to-one mapping from elements of an optimal solution to elements of the algorithm's output. For cost minimization problems, the function can be any one-to-one mapping from elements of the algorithm's output to elements of an optimal solution.

Contents

Correctness

In order for an algorithm to optimally solve a profit maximization problem, the algorithm must produce an output that has as much profit as the optimal solution for every possible input. Let |A(I)| denote the profit of the algorithm's output given an input I, and let |OPT(I)| denote the profit of an optimal solution for I. If an injective function h : OPT(I) → A(I) exists, it follows that |OPT(I)||A(I)|. Since the optimal solution has the greatest profit attainable, this means that the output given by the algorithm is just as profitable as the optimal solution, and so the algorithm is optimal.

The correctness of the charging argument for a cost minimization problem is symmetric. If |A(I)| and |OPT(I)| denote the cost of the algorithm's output and optimal solution respectively, then the existence of an injective function h : A(I) → OPT(I) would mean that |A(I)||OPT(I)|. Since the optimal solution has the lowest cost, and the cost of the algorithm is the same as the cost of the optimal solution of the minimization problem, then the algorithm also optimally solves the problem.

Variations

Charging arguments can also be used to show approximation results. In particular, it can be used to show that an algorithm is an n-approximation to an optimization problem. Instead of showing that an algorithm produces outputs with the same value of profit or cost as the optimal solution, show that it attains that value within a factor of n. Rather than proving the existence of a one-to-one function, the charging argument focuses on proving that an n-to-one function exists in order to prove approximation results.

Examples

Interval Scheduling Problem

Given a set of n intervals I = {I1, I2, ... , In}, where each interval IiI has a starting time si and a finishing time fi, where si < fi, the goal is to find a maximal subset of mutually compatible intervals in I. Here, two intervals Ij and Ik are said to be compatible if they do not overlap, in that sj < fj ≤ sk < fk.

Consider the earliest finish time greedy algorithm, described as follows:

The interval scheduling problem can be viewed as a profit maximization problem, where the number of intervals in the mutually compatible subset is the profit. The charging argument can be used to show that the earliest finish time algorithm is optimal for the interval scheduling problem.

Given a set of intervals I = {I1, I2, ... , In}, let OPT(I) be any optimal solution of the interval scheduling problem, and let EFT(I) be the solution of the earliest finishing time algorithm. For any interval J ∈ OPT(I), define h(J) as the interval J' ∈ EFT(I) that intersects J with the earliest finishing time amongst all intervals in EFT(I) intersecting J. To show that the earliest finish time algorithm is optimal using the charging argument, h must be shown to be a one-to-one function mapping intervals in OPT(I) to those in EFT(I). Suppose J is an arbitrary interval in OPT(I).

Show that h is a function mapping OPT(I) to EFT(I).

Assume for a contradiction that there is no interval J' ∈ EFT(I) satisfying h(J) = J'. By definition of h, this means that no interval in EFT(I) intersects with J. However, this would also mean that J is compatible with every interval in EFT(I), and so the earliest finishing time algorithm would have added J into EFT(I), and so J ∈ EFT(I). A contradiction arises, since J was assumed to not intersect with any interval in EFT(I), yet J is in EFT(I), and J intersects with itself. Thus by contradiction, J must intersect with at least one interval in EFT(I).
It remains to show that h(J) is unique. Based on the definition of compatibility, it can never be the case that two compatible intervals have the same finishing time. Since all intervals in EFT(I) are mutually compatible, none of these intervals have the same finishing time. In particular, every interval in EFT(I) that intersects with J have distinct finishing times, and so h(J) is unique.

Show that h is one-to-one.

Assume for a contradiction that h is not injective. Then there are two distinct intervals in OPT(I), J1 and J2, such that h maps both J1 and J2 to the same interval J' ∈ EFT(I). Without loss of generality, assume that f1 < f2. The intervals J1 and J2 cannot intersect because they are both in the optimal solution, and so f1 ≤ s2< f2. Since EFT(I) contains J' instead of J1, the earliest finishing time algorithm encountered J' before J1. Thus, f' ≤ f1. However, this means that f' ≤ f1 ≤ s2< f2, so J' and J2 do not intersect. This is a contradiction because h cannot map J2 to J' if they do not intersect. Thus by contradiction, h is injective.

Therefore, h is a one-to-one function mapping intervals in OPT(I) to those in EFT(I). By the charging argument, the earliest finishing time algorithm is optimal.

Job Interval Scheduling Problem

Consider the job interval scheduling problem, an NP-hard variant of the interval scheduling problem visited earlier. As before, the goal is to find a maximal subset of mutually compatible intervals in a given set of n intervals, I = {I1, I2, ... , In}. Each interval IiI has a starting time si, a finishing time fi, and a job class ci. Here, two intervals Ij and Ik are said to be compatible if they do not overlap and have different classes.

Recall the earliest finishing time algorithm from the previous example. After modifying the definition of compatibility in the algorithm, the charging argument can be used to show that the earliest finish time algorithm is a 2-approximation algorithm for the job interval scheduling problem.

Let OPT(I) and EFT(I) denote the optimal solution and the solution produced by the earliest finishing time algorithm, as earlier defined. For any interval J ∈ OPT(I), define h as follows:

To show that the earliest finish time algorithm is a 2-approximation algorithm using the charging argument, h must be shown to be a two-to-one function mapping intervals in OPT(I) to those in EFT(I). Suppose J is an arbitrary interval in OPT(I).

Show that h is a function mapping OPT(I) to EFT(I).

First, notice that there is either some interval in EFT(I) with the same job class as J, or there isn't.
Case 1. Suppose that some interval in EFT(I) has the same job class as J.
If there is an interval in EFT(I) with the same class as J, then J will map to that interval. Since the intervals in EFT(I) are mutually compatible, every interval in EFT(I) must have a different job class. Thus, such an interval is unique.
Case 2. Suppose that there are no intervals in EFT(I) with the same job class as J.
If there are no intervals in EFT(I) with the same class as J, then h maps J to the interval with the earliest finishing time amongst all intervals in EFT(I) intersecting J. The proof of existence and uniqueness of such an interval is given in the previous example.

Show that h is two-to-one.

Assume for a contradiction that h is not two-to-one. Then there are three distinct intervals in OPT(I), J1, J2, and J3, such that h maps each of J1, J2, and J3 to the same interval J' ∈ EFT(I). By the pigeonhole principle, at least two of the three intervals were mapped to J' because they have the same job class as J ', or because J ' is the interval with the earliest finishing time amongst all intervals in EFT(I) intersecting both intervals. Without loss of generality, assume that these two intervals are J1 and J2.
Case 1. Suppose J1 and J2 were mapped to J ' because they have the same job class as J '.
Then each J ', J1, and J2 have the same job class. This is a contradiction, since the intervals in the optimal solution must be compatible, yet J1 and J2 are not.
Case 2. Suppose J ' is the interval with the earliest finishing time amongst all intervals in EFT(I) intersecting both J1 and J2.
The proof of this case is equivalent to the one in the previous example that showed injectivity. A contradiction follows from the proof above.

Therefore, h maps no more than two distinct intervals in OPT(I) to the same interval in EFT(I), and so h is two-to-one. By the charging argument, the earliest finishing time algorithm is a two-approximation algorithm for the job interval scheduling problem.

Related Research Articles

Algorithm Unambiguous specification of how to solve a class of problems

In mathematics and computer science, an algorithm is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation. Algorithms are always unambiguous and are used as specifications for performing calculations, data processing, automated reasoning, and other tasks.

Travelling salesman problem problem of finding the shortest route between two points on a graph whose edges are labelled with lengths

The travelling salesman problem asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?" It is an NP-hard problem in combinatorial optimization, important in theoretical computer science and operations research.

Linear programming promramming method to achieve the best outcome in a mathematical model

Linear programming is a method to achieve the best outcome in a mathematical model whose requirements are represented by linear relationships. Linear programming is a special case of mathematical programming.

Greedy algorithm algorithm that makes locally optimal choices in a sequence of steps with the goal of reaching a global optimum

A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not usually produce an optimal solution, but nonetheless a greedy heuristic may yield locally optimal solutions that approximate a globally optimal solution in a reasonable amount of time.

Dynamic programming method for solving a complex problem by breaking it down into a collection of simpler subproblems

Dynamic programming is both a mathematical optimization method and a computer programming method. The method was developed by Richard Bellman in the 1950s and has found applications in numerous fields, from aerospace engineering to economics.

In machine learning, the perceptron is an algorithm for supervised learning of binary classifiers. A binary classifier is a function which can decide whether or not an input, represented by a vector of numbers, belongs to some specific class. It is a type of linear classifier, i.e. a classification algorithm that makes its predictions based on a linear predictor function combining a set of weights with the feature vector.

In the bin packing problem, items of different volumes must be packed into a finite number of bins or containers each of a fixed given volume in a way that minimizes the number of bins used. In computational complexity theory, it is a combinatorial NP-hard problem. The decision problem is NP-complete.

In computer science, local search is a heuristic method for solving computationally hard optimization problems. Local search can be used on problems that can be formulated as finding a solution maximizing a criterion among a number of candidate solutions. Local search algorithms move from solution to solution in the space of candidate solutions by applying local changes, until a solution deemed optimal is found or a time bound is elapsed.

Combinatorial optimization subset of mathematical optimization

Combinatorial optimization is a subfield of mathematical optimization that is related to operations research, algorithm theory, and computational complexity theory. It has important applications in several fields, including artificial intelligence, machine learning, auction theory, software engineering, applied mathematics and theoretical computer science.

Multi-disciplinary design optimization (MDO) is a field of engineering that uses optimization methods to solve design problems incorporating a number of disciplines. It is also known as multidisciplinary system design optimization (MSDO).

Reduction (complexity) transformation of one computational problem to another, used to show that the second problem is as difficult as the first

In computability theory and computational complexity theory, a reduction is an algorithm for transforming one problem into another problem. A sufficiently efficient reduction from one problem to another may be used to show that the second problem is at least as difficult as the first.

In mathematics, a Markov decision process (MDP) is a discrete-time stochastic control process. It provides a mathematical framework for modeling decision making in situations where outcomes are partly random and partly under the control of a decision maker. MDPs are useful for studying optimization problems solved via dynamic programming and reinforcement learning. MDPs were known at least as early as the 1950s; a core body of research on Markov decision processes resulted from Ronald Howard's 1960 book, Dynamic Programming and Markov Processes. They are used in many disciplines, including robotics, automatic control, economics and manufacturing. The name of MDPs comes from the Russian mathematician Andrey Markov as they are an extension of Markov chains.

Interval scheduling is a class of problems in computer science, particularly in the area of algorithm design. The problems consider a set of tasks. Each task is represented by an interval describing the time in which it needs to be executed. For instance, task A might run from 2:00 to 5:00, task B might run from 4:00 to 10:00 and task C might run from 9:00 to 11:00. A subset of intervals is compatible if no two intervals overlap. For example, the subset {A,C} is compatible, as is the subset {B}; but neither {A,B} nor {B,C} are compatible subsets, because the corresponding intervals within each subset overlap.

In computer science, artificial intelligence, and mathematical optimization, a heuristic is a technique designed for solving a problem more quickly when classic methods are too slow, or for finding an approximate solution when classic methods fail to find any exact solution. This is achieved by trading optimality, completeness, accuracy, or precision for speed. In a way, it can be considered a shortcut.

In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running, or continue to run forever. Alan Turing proved in 1936 that a general algorithm to solve the halting problem for all possible program-input pairs cannot exist. For any program f that might determine if programs halt, a "pathological" program g called with an input can pass its own source and its input to f and then specifically do the opposite of what f predicts g will do. No f can exist that handles this case. A key part of the proof was a mathematical definition of a computer and program, which became known as a Turing machine; the halting problem is undecidable over Turing machines. Turing's proof is one of the first cases of decision problems to be concluded. The theoretical conclusion that it is not solvable is significant to practical computing efforts, defining a class of applications which no programming invention can possibly perform perfectly.

The activity selection problem is a combinatorial optimization problem concerning the selection of non-conflicting activities to perform within a given time frame, given a set of activities each marked by a start time (si) and finish time (fi). The problem is to select the maximum number of activities that can be performed by a single person or machine, assuming that a person can only work on a single activity at a time. The activity selection problem is also known as the Interval scheduling maximization problem (ISMP), which is a special type of the more general Interval Scheduling problem.

David Shmoys American mathematician

David Bernard Shmoys is a Professor in the School of Operations Research and Information Engineering and the Department of Computer Science at Cornell University. He obtained his Ph.D. from the University of California, Berkeley in 1984. His major focus has been in the design and analysis of algorithms for discrete optimization problems.

In computational geometry, a maximum disjoint set (MDS) is a largest set of non-overlapping geometric shapes selected from a given set of candidate shapes.

In computer science, an optimal binary search tree , sometimes called a weight-balanced binary tree, is a binary search tree which provides the smallest possible search time for a given sequence of accesses. Optimal BSTs are generally divided into two types: static and dynamic.

Truthful job scheduling is a mechanism design variant of the job shop scheduling problem from operations research.

References