1. Introduction
In the last decade, the mathematical understanding of adaptive finite element methods (AFEM) has matured. For many elliptic model problems, one can mathematically prove that AFEM leads to optimal convergence behavior; see, e.g., [CFPP14] and the references therein. Starting from an initial mesh , the usual AFEM algorithms iterate the loop
(1) 
The latter generates a sequence of successively refined meshes together with the associated FEM solutions and a posteriori
error estimators
, where the index is the step counter of the adaptive loop. Formally, the algorithm reads as follows: For all , iterate the following steps:
Compute the FEM solution corresponding to .

Compute certain refinement indicators for all .

Determine a subset of elements for refinement.

Generate a new mesh by refinement of (at least) all marked elements.
Usually, the set from then contains the elements with the largest contributions . Often (and, in particular, for the analysis of rate optimality [CFPP14]), the Dörfler marking criterion [Dör96] is used: Given , construct such that
(2) 
i.e., the marked elements control a fixed percentage of the overall error estimator. Clearly, one aims to choose the set with as few elements as possible.
As far as convergence of AFEM is concerned, also other marking criteria can be considered [MSV08, Sie11]. When the focus comes to the overall computational cost of AFEM, then the (quasi) minimal Dörfler marking (2) becomes necessary [CFPP14] and it is important that all steps can be performed at linear cost with respect to the number of elements . This is usually a reasonable assumption if employs iterative solvers like PCG [FHPS18] or multigrid [Ste07], and it requires appropriate data structures for and .
If aims for a set , which satisfies (3) with minimal cardinality, then linear cost is less obvious: The work [Dör96] notes that a possible strategy is to sort the indicators, which, however, results in loglinear costs. Instead, the work [Ste07] employs an approximate sorting by binning. While this leads to linear costs, the resulting set has only minimal cardinality up to a multiplicative factor , and [Ste07, Section 5] notes:
Selecting that satisfies (2) with true minimal cardinality would require sorting all by the values of , which takes operations.
The present work bridges the approaches of [Dör96, Ste07] and proves that the latter statement is wrong: Based on ideas of the (Quick) Selection algorithm [Hoa61], we present a linearcost algorithm for , which provides a set , which satisfies the Dörfler criterion (2) with minimal cardinality.
The outline of the present work reads as follows: In Section 2, we formulate the Dörfler marking and briefly discuss the algorithms from [Dör96, Ste07]. In Section 3, we present and analyze our new approach for named QuickMark. Section 3.4 concludes with a C++11 STLbased implementation of the new algorithm.
2. Dörfler marking
2.1. Setting
Let and
. Given a vector
, an index set satisfies the Dörfler criterion, if(3) 
By , we denote the number of elements in . Let denote the minimal number of indices which are required to satisfy the Dörfler criterion (3). We note that the minimizing set is not unique in general, e.g., if for all and .
Remark 1. For , the set of minimal cardinality satisfying (3) is unique and given by . Clearly, this set can be determined at linear costs.
We say that an algorithm realizes the minimal Dörfler marking, if, for all , for all , and for all , the algorithm constructs a set , which satisfies (3) with . We say that an algorithm realizes the quasiminimal Dörfler marking, if, for all , there exists a constant such that, for all and for all , the algorithm constructs a set , which satisfies (3) with .
2.2. Minimal Dörfler marking based on sorting
It is already noted in [Dör96] that a set , which satisfies (3) as well as , can easily be constructed by sorting.
Algorithm 2. For the setting from Section 2.1, perform the following steps (i)–(iii):

Determine a permutation such that .

Compute .

Determine the minimal index such that .
Output:
In practice, step (i) of Algorithm 2.2 will be performed by sorting the vector . This leads to operations for, e.g., the Introsort algorithm [Mus97].
2.3. Dörfler marking without sorting
To avoid sorting, the work [Dör96] proposes (a variant of) the following algorithm; see [Dör96, Section 5.2].
Algorithm 4. For the setting from Section 2.1 and given , perform the following steps (i)–(vi):

Initialize , and for all .

Compute and .

For , iterate the following steps:

For all with , iterate the following steps:

if , then define and update

if , then terminate.


Output:
Remark 5. The algorithm proposed in [Dör96, Section 5.2] has the stopping criterion (vi) as part of step (iii), i.e., steps (iv)–(v) are iterated, until . If is constant, i.e., for all , then this variant leads to for all and hence does not realize quasiminimal Dörfler marking. Our formulation of Algorithm 2.3 excludes such a simple counterexample.
Proposition 6. Algorithm 2.3 terminates after finitely many steps. The computational cost of Algorithm 2.3 is . The set generated by Algorithm 2.3 realizes (3), but it is not quasiminimal in general.
Proof.
Steps (i)–(ii) have linear costs . Obviously, if in step (vi) the sum is rather updated than recomputed, step (iii)–(vi) lead to total costs for Algorithm 2.3. To see that satisfies (3), note that (at latest) for , it holds that and hence is satisfied for all . It only remains to show that Algorithm 2.3 does not realize the quasiminimal Dörfler marking.
Let and be arbitrary. We aim to show that for any constant , there exist and such that the set generated by Algorithm 2.3 satisfies . Without loss of generality, we may assume . The idea now is the following:

For some and , define the vector of the form

Then, choose and such that satisfies (3), but neither nor do.

Now, if is chosen small enough, then the set returned by Algorithm 2.3 will be a superset of , i.e., .

Since satisfies (3), it holds that and hence .
It remains to define , and such that the desired properties hold. Define
Note that implies that . First, note that
Hence, satisfies (3) and therefore . Next, we claim that Algorithm 2.3 will construct a set , which thus contains more than indices: Observe that
This proves that . Together with , this implies that the condition in Step (v) of Algorithm 2.3 will not be satisfied for any before the last iteration of the loop in Step (iii) of Algorithm 2.3 (i.e., before ). Thus, for , we have , , and for all . Note, that
Consequently, after the last iteration of the loop it holds that for all and . Hence, the set returned by Algorithm 2.3 satisfies . This concludes the proof. ∎
2.4. Quasiminimal Dörfler marking with linear complexity by binning
The following strategy has been proposed in the seminal work [Ste07], which gave the first optimality proof for a standard AFEM loop of type (1) for the 2D Poisson problem. The main observation is the following: If the reduction of the threshold in step (v) of Algorithm 2.3 is done by multiplication instead of subtraction, then the resulting algorithm satisfies the quasiminimal Dörfler marking. While [Ste07, Section 5] outlines the proposed strategy for the choice , we work out all details in our proof of Proposition 2.4.
Algorithm 7. For the setting from Section 2.1 and given , perform the following steps (i)–(v):

Compute and .

Determine the minimal with .

For , fill bins and define .

This yields a permutation such that

for all and with .


Determine the minimal index such that .
Output:
Proposition 8. For arbitrary , Algorithm 2.4 terminates after finitely many steps. The constructed set satisfies (3) with . Moreover, a proper implementation of Algorithm 2.4 leads to a total computational cost of with .
Proof.
The only nonobvious statement is the bound : For , it holds that and hence
Since and for all , it follows that satisfies (3). Let be the largest index such that . If no such index exists, i.e., , define . Clearly, it holds that and . Further, there exists such that satisfies (3) with minimal cardinality .
To show , it suffices to show that satisfies . Consider . Then, , , and with , it holds that
It immediately follows, that . Altogether, satisfies (3) with . ∎
3. Minimal Dörfler marking with linear complexity
This section constitutes the main contribution of this work. Theorem 9. Dörfler marking with minimal cardinality is a linear complexity problem. More precisely, a call of Algorithm 3.1 below with a vector leads after operations to a set with (3) and . We prove this main theorem explicitly by introducing the QuickMark algorithm in Section 3.1. The correctness of the QuickMark algorithm is proved in Section 3.2 and the linear complexity of QuickMark is shown in Section 3.3. Section 3.4 concludes with some remarks on the implementation of the algorithm.
3.1. The QuickMark algorithm
Adapting the divideandconquer strategy of efficient selection algorithms [Hoa61], we propose a new strategy to determine, at linear costs, a subset with (3) and . The proposed algorithm consists of an initial call (Algorithm 3.1) and the function QuickMark (Algorithm 3.1), which steers the divideandconquer strategy based on the subroutines Pivot (Algorithm 3.1) and Partition (Algorithm 3.1).
To improve readability throughout this chapter, whenever a permutation on would be altered by a function, that function instead is written to take the permutation as input and returns as output the new permutation . If a permutation is not changed by a function, it is simply denoted by . Moreover, let represent the identity permutation on , i.e., for all . For an index set define .
Algorithm 10 (Initial call of QuickMark). For the setting from Section 2.1, we perform the following steps (i)–(iv):

Initialize the identity permutation .

Define lower index and upper index .

Compute the goal value .

Call QuickMark
Output:
Analogously to selection algorithms [Hoa61], the QuickMark algorithm is based on the subroutine Partition, where elements are essentially separated into two classes: Those elements with smaller value than the pivot element, and those with greater value than the pivot element. Then, the algorithm decides, which of the two classes is not to be inspected further.
Algorithm 11 ( QuickMark). Input: Vector , permutation on , goal value , lower and upper indices .

Determine a pivot index Pivot.

Determine a new permutation via Partition.

Compute the sum of the greatest elements .

If , then return QuickMark

Else, if , then return

Else return QuickMark
Output: Permutation of and index .
The Pivot subroutine should determine a feasible pivot element of a given (sub) array. While the concrete choice of the pivot strategy is irrelevant for the correctness of the procedure, it is the decisive factor for the computational complexity of the divideandconquer strategy. For now, we consider an arbitrarily (e.g., randomly) chosen . While in Section 3.2 correctness of the algorithm is proved independently of the concrete pivot strategy, in Section 3.3 we propose a pivot strategy that leads — even in the worst case — to linear complexity of Algorithm 3.1.
Algorithm 12 ( Pivot). Input: Vector , permutation on , lower and upper indices .

Use to determine a pivot index .
Output: Pivot index .
For a given pivot element, the Partition subroutine reorganizes the elements of an (sub) array depending on whether they are greater than, smaller than, or equal to the pivot.
Algorithm 13 ( = Partition). Input: Vector , permutation on , lower and upper indices , pivot index .

Compute a permutation on together with the unique indices and such that the following three implications hold true for all :

If , then .

If , then .

If , then .


Define
Output: Permutation of together with indices and .
The following remark collects some important observations (4)–(5) about the state of and in Algorithm 3.1. The validity of (4) will be shown in Proposition 3.2.1 in Section 3.2. The properties (5) follow directly from Algorithm 3.1. Remark 14. When Partition (Algorithm 3.1) is called in step (ii) of QuickMark (Algorithm 3.1), the permutation and the indices satisfy
(4a)  
(4b) 
This is illustrated in Figure 1.
3.2. Correctness of the QuickMark algorithm
We consider , permutations on , indices with , and a value . Proving the correctness of QuickMark (Algorithm 3.1) is organized into three steps: In Section 3.2.1 we verify some essential properties satisfied by the input parameters of calls to Algorithm 3.1. Section 3.2.2 introduces auxiliary subproblems generated and solved by Algorithm 3.1 and gives insight on the idea behind the QuickMark strategy. Termination of Algorithm 3.1 is investigated in Section 3.2.3, where the correctness is proved.
3.2.1. Admissible calls to QuickMark
We consider the following crucial properties, which will be shown to be always satisfied in Proposition 3.2.1. Definition 15. A call QuickMark to Algorithm 3.1 is called admissible, if the inputs satisfy the following conditions (a)–(b):

It holds that
(6a) (6b) 
It holds that
(7)
In fact, the following proposition shows that recursive calls of QuickMark preserve the admissibility conditions. Proposition 16. If QuickMark is initially called by Algorithm 3.1(iv), then each subsequent recursive call QuickMark from step (iv) or (vi) of Algorithm 3.1 is admissible.
Proof.
The statement follows directly by induction. First, we show that the initial call QuickMark of Algorithm 3.1 initiated by Algorithm 3.1(iv) with the inputs , , , , and is admissible: Since and , Definition 3.2.1(a) contains only statements about indices in the empty set and is therefore satisfied. Definition 3.2.1(b) follows from , , and the definition of .
For the induction step, consider an admissible call QuickMark of Algorithm 3.1. We show that a potential subsequent call QuickMark initiated by either Algorithm 3.1(iv) (i.e., , , ), or by Algorithm 3.1(vi) (i.e., , , ), is also admissible: By (a), (b) we refer to the assumption, i.e., the admissibility conditions of Definition 3.2.1 satisfied by QuickMark. We aim to show the corresponding admissibility conditions of Definition 3.2.1 for the call QuickMark, which will be denoted by , .
Recall, that in either case (step (iv) or step (vi) in Algorithm 3.1), differs from only on the index set . Therefore, in both cases follows from (5a)–(5c) and (a). If recursion relies on Algorithm 3.1(iv), then , , and . Hence,
proves . If recursion relies on Algorithm 3.1(vi), then , , and
(8) 
Combining (b) and the last estimate yields for that
This shows . ∎
3.2.2. Subproblems generated by QuickMark
To analyze Algorithm 3.1, we introduce some auxiliary notation. In particular, the symbol will be used differently than in Section 2.1. The connection between the two notations is clarified in Remark 3.2.2.
By , we denote the power set of . For any admissible call QuickMark to Algorithm 3.1, let consist of all such that
(9a)  
(9b) 
The following remark follows immediately from (9a)–(9b) and connects the introduced notation to the Dörfler marking criterion (3) from Section 2.1. Remark 17. For arbitrary , the set satisfies (3) with minimal cardinality .
Later in Section 3.2.3, we will prove that QuickMark called by Algorithm 3.1 determines a set . The core idea behind the proof is the observation that for an admissible call QuickMark, the set can be written as
Hence, an admissible call QuickMark to Algorithm 3.1 either determines a set and terminates in step (v), or it initiates another admissible recursive call denoted by QuickMark in step (iv) or step (vi), where , i.e., the problem is reduced to a strict subproblem.
First, we will show, that all occurring subproblems of finding are wellposed. In fact, for an admissible call QuickMark the set is always nonempty and all attain the same minimum in . Lemma 18. Let QuickMark be an admissible call to Algorithm 3.1. Then, . Moreover, the definition
Comments
There are no comments yet.