Professional Documents
Culture Documents
ADAM STRZEBOŃSKI
A BSTRACT. We present an algorithm for exact global optimization of real algebraic func-
tions on subsets of lRn described by systems of real algebraic equations and inequalities.
The algorithm is based on the Cylindrical Algebraic Decomposition (CAD) algorithm. We
also give a substantially simpler algorithm for the special case of optimization of rational
functions on subsets of lRn described by systems of strong polynomial inequalities. We
give some examples and present results of some experiments with our implementation of
the algorithms within Mathematica.
1. I NTRODUCTION
In order to state the main problem in precise terms let us define the notion of real alge-
braic function we use throughout the paper.
Definition 1.1. A basic algebraic function given by a polynomial p(x1 ; : : : ; xn ; y) and an
integer k is the function
Rooty;k p : lRn 3 x1 ; : : : ; xn ?! Rooty;k p(x1 ; : : : ; xn ) 2 lR
where Rooty;k p(x1 ; : : : ; xn ) is the k -th real root of p(x1 ; : : : ; xn ; y ) treated as a univari-
ate polynomial in y . The function is defined for those values of x1 ; : : : ; xn for which
p(x1 ; : : : ; xn ; y) has at least k real roots. The real roots are ordered by the increasing
value, counting multiplicities.
Example 1.2.
Rooty;1 (y ? x1 )(y ? x2 ) min(x1 ; x2 )
=
r x2
Rooty;2 (x1 y2 ? x2 ) =
x1
The first function is defined for all (x1 ; x2 ) 2 2 , the second for f(x1 ; x2 ) 2 lR2 : (x1 >
lR
0 ^ x2 0) _ (x1 < 0 ^ x2 0)g.
inequalities.) We say that S (a1 ; : : : ; an ) is true, for a point (a1 ; : : : ; an ) 2 lRn , if there
is 1 j t such that the point belongs to the domain of all algebraic functions in Sj ,
and satisfies all the equations and inequalities in Sj . If S (a1 ; : : : ; an ) is true we call
(a1 ; : : : ; an ) a solution of S .
Example 1.4. We do not require that a solution must belong to domains of all algebraic
functions in the entire system . For instance the set of solutions of
p p
x 0 ^ x < 1) _ (x < 0 ^ ?x < 1)
(
The purpose of this section is to describe the general idea of the CAD algorithm. For
details consult [1].
Definition 2.1. A cell is a subset of lRn defined recursively as follows
1. A cell in lR is a point or an open interval.
2. A cell in lRk+1 has one of the two forms
f(a1 ; : : : ; ak ; ak+1 ) a1 ; : : : ; ak ) 2 CLk ^ ak+1 = r(a1 ; : : : ; ak )g
: (
f(a1 ; : : : ; ak ; ak+1 )
: (a1 ; : : : ; ak ) 2 CLk ^ r1 (a1 ; : : : ; ak ) < ak+1 < r2 (a1 ; : : : ; ak )g
where CLk is a cell in lRk , r is a basic algebraic function defined and continuous on
CLk , and r1 and r2 are basic algebraic functions defined and continuous on CLk ,
?1, or 1.
Definition 2.2. For a finite set of polynomials F lR[x1 ; : : : ; xn ], a cylindrical decom-
position of lRn consistent with F is a finite collection of disjoint cells such that their union
covers lRn and on each of the cells each polynomial of F has a constant sign.
Algorithm 2.3. (CAD) The input is a finite set of polynomials F lR[x1 ; : : : ; xn ]. The
algorithm finds a cylindrical decomposition of lRn consistent with F , and gives a sample
point in each cell of the decomposition.
GLOBAL OPTIMIZATION OF REAL ALGEBRAIC FUNCTIONS 3
The algorithm consists of two phases. In the projection phase we find a sequence of finite
sets of polynomials (Fn ; : : : ; F1 ), such that
1. Fk lR[x1 ; : : : ; xk ], for 1 k n.
2. For 1 k n ? 1, if all polynomials of Fk have constant signs on a cell CLk lRk ,
then polynomials of Fk+1 are delineable on CLk , i.e. each polynomial f 2 Fk+1
has a constant number df of real roots on CLk (as a polynomial in xk+1 ), for each
1 i df , Rootxk+1 ;i f is continuous on CLk , and for each g 2 Fk+1 and
1 j dg , either
_ ^
of a system of real polynomial equations and inequalities
fi;j (x1 ; : : : ; xn )i;j 0
1il 1jm
4 ADAM STRZEBOŃSKI
where fi;j 2 lR[x1 ; : : : ; xn ], and each i;j is one of <; ; ; >; =; or 6=, we can proceed
as follows. We compute a cylindrical decomposition of lRn consistent with F = ffi;j :
1 i l; 1 j mg. Each cell is either disjoint from the solution set of the system
or contained in the solution set of the system. To minimize the value of x1 on the solution
set we find a cell which is contained in the solution set and whose projection on x1 axis
contains the lowest values of x1 . The general idea of the minimization algorithm, we
describe in the following section, is to reduce the general minimization problem to the
problem we have just described and use the CAD algorithm. The second phase of the CAD
algorithm needs to use some information from the reduction phase, and we customize the
CAD algorithm to compute just the information we need.
Algorithm 3.1. The input is a system S (x1 ; : : : ; xn ) of real algebraic equations and in-
equalities and a real algebraic function f (x1 ; : : : ; xn ). The algorithm finds infS (f ), and,
if possible, a point (a1 ; : : : ; an ) such that S (a1 ; : : : ; an ) is true, and f (a1 ; : : : ; an ) =
infS (f ).
3.1. Reduction to minimization of a coordinate function. Let z be a new variable, let
S 0 (x1 ; : : : ; xn ; z ) = S (x1 ; : : : ; xn ) ^ z f (x1 ; : : : ; xn ), and let zinf = infS0 (z ).
We write S 0 in the disjunctive normal form. It is easy to see that zinf = infS (f ).
Moreover, there is a one-to-one correspondence between points (a1 ; : : : ; an ) such that
S (a1 ; : : : ; an ) is true and f (a1 ; : : : ; an ) = infS (f ) and points (a1 ; : : : ; an ; zinf ) such
that S 0 (a1 ; : : : ; an ; zinf ) is true. Therefore it suffices to show an algorithm for finding
zinf and, if possible, a point (a1 ; : : : ; an ; zinf ) such that S 0 (a1 ; : : : ; an ; zinf ) is true.
3.2. Polynomialization.
Definition 3.2. A polynomial system with algebraic conditions
PC (x1 ; : : : ; xn ; y1 ; : : : ; ym; z )
is a pair of a system
P (x1 ; : : : ; xn ; y1 ; : : : ; ym ; z )
of real polynomial equations and inequalities, and a system C of conditions
y1 = g1 (x1 ; : : : ; xn ; z )
y2 = g2 (x1 ; : : : ; xn ; y1 ; z )
..
.
ym = gm (x1 ; : : : ; xn ; y1 ; : : : ; ym?1 ; z )
where
gi (x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z ) = Rooty;k p(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z )
for some polynomial p, or
gi (x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z ) = r(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z )k=l
for some rational function r and rational number k=l. Let P = P1 _ : : : _ Pt . We say that
PC (a1 ; : : : ; an ; b1 ; : : : ; bm ; c)
is true if there is 1 j t such that
Pj (a1 ; : : : ; an ; b1; : : : ; bm; c)
GLOBAL OPTIMIZATION OF REAL ALGEBRAIC FUNCTIONS 5
is true, and for each 1 i m either Pj does not depend on yi and any of yi 0 such that
gi0 depends on yi , or
bi = gi (a1 ; : : : ; an ; b1 ; : : : ; bi?1 ; c)
If PC (a1 ; : : : ; an ; b1 ; : : : ; bm ; c) is true we call (a1 ; : : : ; an ; b1 ; : : : ; bm ; c) a solution of
PC .
We will find a polynomial system with algebraic conditions
PC (x1 ; : : : ; xn ; y1 ; : : : ; ym; z )
such that the infimum of values of z on the set of solutions of PC is equal to zinf , and
S 0 (a1 ; : : : ; an ; zinf ) is true if and only if there is (b1 ; : : : ; bm ) such that
PC (a1 ; : : : ; an ; b1 ; : : : ; bm ; zinf )
is true. This will reduce the original problem to the problem of finding the infimum of
values of z on the set of solutions of PC , and a solution (a1 ; : : : ; an ; b1 ; : : : ; bm ; c) of PC
with c = zinf .
We start with the system P = S 0 and an empty system of conditions C . First we
successively replace algebraic functions in P with new variables (y1 ; : : : ; ym ), starting
with the innermost basic algebraic functions or radicals. When replacing
Rooty;k p(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z )
with a new variable yi , we add
yi = Rooty;k p(x1 ; : : : ; xn ; y1; : : : ; yi?1 ; z )
to the system C of conditions. We also add the equation
p(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z; yi) = 0
to all terms of the alternative P which contained the replaced basic algebraic function.
(This is not necessary for PC to have the properties stated above, but we will need it in the
next stage of the algorithm.) Similarly, we replace radicals
r(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z )k=l
with yik and add
yi = r(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z )k=l
to the system C of conditions. We also add the equation
yil = r(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z )
and the inequality
r(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z ) 0
to all terms of the alternative P which contained the replaced radical. This makes P a
system of rational function equations and inequalities.
Next, we put all equations and inequalities in the form r < 0, r 0, r = 0, or r 6= 0,
put all rational functions in the “common denominator” form, and replace equations and
inequalities involving rational functions using equivalences
p=q < 0 , (p > 0 ^ q < 0) _ (p < 0 ^ q > 0)
p=q 0 , (p 0 ^ q < 0) _ (p 0 ^ q > 0)
p=q = 0 , p = 0 ^ q 6= 0
p=q 6= 0 , p 6= 0 ^ q 6= 0
6 ADAM STRZEBOŃSKI
Finally, we put the, now polynomial, equation and inequality system in the disjunctive
normal form. It is easy to see that so constructed polynomial equation and inequality
system P and system of conditions C have the required properties.
3.3. Minimization. Given a polynomial system with algebraic conditions
PC (x1 ; : : : ; xn ; y1 ; : : : ; ym; z )
we find the infimum zinf of values of z on the set of solutions of PC , and, if possible, a
solution (a1 ; : : : ; an ; b1 ; : : : ; bm ; c) of PC with c = zinf .
From now on the algorithm is a simple modification of the classical Cylindrical Alge-
braic Decomposition algorithm and its correctness directly follows from the correctness
of CAD. We use the standard terminology, and describe only our modifications. For the
details of the CAD algorithm see [2], [1].
We start with the projection phase of CAD. We use the improved projection operators
from [3], [6], [7], and [5] as appropriate (in this order of preference). The last projection
operator is used if during the sample point construction phase we detect that the system is
not well oriented (see [7]). First we project with respect to ym ; : : : ; y1 , in this order, then
with respect to x1 ; : : : ; xn , in any order. At the end we are left with univariate polynomials
in z .
Next, we start the sample point construction phase of CAD. We find
p0 < r 1 < p 1 < r 2 < : : : < r k < p k
where r1 ; : : : ; rk are all roots of the univariate polynomials in z and p0 ; : : : ; pk are rational
numbers. Starting with p0 we attempt to find a sample point in a cell on which PC is true,
using the depth-first strategy and early elimination of false cells as in [4]. The difference
with the classical CAD is in extending the sample points to yi variables, so let us describe
in more detail how we extend a sample point to yi .
Suppose we have constructed coordinates (a1 ; : : : ; an ; b1 ; : : : ; bi?1 ; c) of a sample
point representing a cell CL. In addition to numerical values we allow none as a value
for yl coordinate of a sample point. bl = none means that there was no value satisfying
the condition in the system C associated with yl . This does not imply yet that the cell
cannot be extended to a cell of solutions of PC , because there may be 1 j t (where
P = P1 _ : : : _ Pt ) such that Pj does not depend on yl . If bl = none we define the yl
coordinate of CL to be unrestricted. Now, we attempt to extend the sample point to a point
(a1 ; : : : ; an ; b1 ; : : : ; bi?1 ; bi ; c).
The condition associated with yi is either
yi = Rooty;k p(x1 ; : : : ; xn ; y1; : : : ; yi?1 ; z )
or
yi = r(x1 ; : : : ; xn ; y1 ; : : : ; yi?1 ; z )k=l
If p or r depends on a yl such that bl = none then there is no bl which would satisfy
the condition, so we set bi = none. Otherwise, in the first case, we check whether
p(a1 ; : : : ; an ; b1 ; : : : ; bi?1 ; c; y) has at least k roots, multiplicities counted. If yes, we
set bi to be the k -th root of p (p is guaranteed to be delineable on CL, because p = 0
was one of the equations in P ), otherwise we set bi = none. In the second case if
r(a1 ; : : : ; an ; b1 ; : : : ; bi?1 ; c) 0 we put
bi = r(a1 ; : : : ; an ; b1 ; : : : ; bi?1 ; c)k=l
else we set bi = none. Since yil = r and r 0 were among the equations and inequalities
in P we are guaranteed that r has a constant sign CL and yil ? r is delineable on CL.
GLOBAL OPTIMIZATION OF REAL ALGEBRAIC FUNCTIONS 7
An important special case of the global optimization problem for which we can signifi-
cantly simplify the algorithm is minimization of a rational function f (x1 ; : : : ; xn ) over the
set of solutions of a system S (x1 ; : : : ; xn ) of strong polynomial inequalities. In this case
we can use a simpler projection operator (see [10]), and we can eliminate computations
with algebraic numbers (see [8], [10]).
Algorithm 4.1. The input is a system S (x1 ; : : : ; xn ) of strong polynomial inequalities, a
rational function f (x1 ; : : : ; xn ), and a number > 0. The algorithm finds infS (f ) and
a point (a1 ; : : : ; an ) with all coordinates rational such that S (a1 ; : : : ; an ) is true, and
f (a1 ; : : : ; an ) ? infS (f ) < .
4.1. Reduction to minimization of a coordinate function. Let f = p=q for polynomials
p = p(x1 ; : : : ; xn ) and q = q(x1 ; : : : ; xn ), let z be a new variable, and let
S 0 = S 0 (x1 ; : : : ; xn ; z ) := S ^ [(q > 0 ^ zq > p) _ (q < 0 ^ zq < p)]
We write S 0 in the disjunctive normal form. Let zinf = infS (z ). It is easy to see0
that zinf = infS (f ). Moreover, if S 0 (a1 ; : : : ; an ; c) is true and c ? zinf < then
S (a1 ; : : : ; an ) is true and f (a1 ; : : : ; an ) ? infS (f ) < . Therefore we reduced the prob-
lem to finding zinf and a point (a1 ; : : : ; an ; c) such that S 0 (a1 ; : : : ; an ; c) is true and
c ? zinf < .
4.2. Minimization. In the following we use the standard CAD terminology, see [1], [2].
Notation 4.2. For a set of polynomials F , let SFRP (F ) denote a set of square-free and
relatively prime polynomials multiplicatively generating F . For a set of square-free and
relatively prime polynomials G, let PR(G; v ) denote the projection of G with respect to v
used in [10]. By definition, PR(G; v ) consists of the leading coefficients, discriminants,
and pairwise resultants of elements of G as polynomials in v .
Remark 4.3. SFRP (F ) is not uniquely determined. For the following discussion it does
not matter which set of square-free and relatively prime polynomials multiplicatively gen-
erating F we use, so we just assume that we have a procedure for computing one. In our
implementation for polynomials with rational number coefficients we use the set of irre-
ducible factors of F , and our experience is that polynomial factorization is not a significant
part of the execution time of the whole algorithm.
8 ADAM STRZEBOŃSKI
points below the graph of r1 is j = 0, or above the graph of rm if j = m). All elements of
Fk+1 have constant nonzero signs on each of CLj , for 0 j m.
For 0 j m, we check whether we can prove that there is no solution of S 0 extending
(a1 ; : : : ; ak ; pj ; c) by looking at inequalities that depend only on (x1 ; : : : ; xk+1 ; z ). If yes
we go to the next j . Otherwise, if k + 1 = n then (a1 ; : : : ; ak ; pj ; c) is a solution of S 0 and
we return it. Else we call FindPoint recursively, and if it gives a solution of S 0 we return it,
else we go to the next j .
If after trying all 0 j m we have not found a solution we return failed.
Remark 4.7. If FindPoint returns failed it has only proved that tuples (ak+1 ; : : : ; an ) for
which (a1 ; : : : ; ak ; ak+1 ; : : : ; an ; c) is not a solution of S 0 form an open and dense subset
of lRn?k . However, since the set of solutions of a system of strong inequalities is open, it
follows that there are no solutions extending (a1 ; : : : ; ak ; c).
A solution (a1 ; : : : ; ak ; ak+1 ; : : : ; an ; c) returned by FindPoint is a sample point in an
open cell CL0 lRn+1 such that the projection of CL0 on the subspace of coordinates
(x1 ; : : : ; xk ; z ) is equal to CL.
5. E XPERIMENTAL RESULTS
In this section show some experimental results obtained with our implementations of
the algorithms presented in this paper. The algorithms were implemented in the C kernel
of Mathematica. The examples were run on a Pentium II, 233 MHz computer with 64 MB
of RAM. We compare performances of the general minimization algorithm (GMA) from
Section 3 and the algorithm for strong inequality systems (SIMA) from Section 4.
1. A geometric problem from [9]. Find all values of k for which the inequality
a3 + b3 + c3 3abc + k(a ? b)(b ? c)(c ? a)
is true for all a, b, and c sides of a triangle. Since by permutation of a, b, and c we can
change the sign of the coefficient at k , we see that the allowable values for k form
an interval symmetric with respect to zero. Therefore it is enough to compute the
maximum of k for which the inequality is true for all a, b, and c, which is the same
as the infimum of k for which there are a, b, and c, such that the opposite inequality
is true. So we need to compute the infimum of k on
a > 0 ^ b > 0 ^ c > 0 ^ k > 0^
a < b + c ^ b < c + a ^ c < a + b^
a3 + b3 + c3 < 3abc + k(a ? b)(b ? c)(c ? a)
p p
We have strong inequalities only, so we can use SIMA, which returns Rooty;2 (y 4 ?
72y 2 ? 432) after 12.35 seconds. In radicals, the answer is 2 9 + 6 3. GMA did
not do this example in an hour.
10 ADAM STRZEBOŃSKI
p p 2 2
2. Maximize x + y on the ellipse x4 + y9 = 1. We can solve the problem directly
using GMA in 2.32 seconds, or we can notice that the maximum is equal to the
4 4
supremum of x + y on x4 + y9 < 1, which we can compute using SIMA in 0.12
seconds. The answer is Rooty;1 (y 12 ? 39y 8 ? 465y 4 ? 2197), with GMA we also
get a point at which the maximum is attained, with SIMA we get only its rational
approximation.
3. Find the minimal distance between the largest and the smallest root of the cubic
x3 + ax + b assuming the cubic has three real roots and its discriminant is ?1. We
need to use GMA here. We get the answer 22=3 for a = ?2?2=3 and b = 0, after
5.58 seconds.
R EFERENCES
[1] B. Caviness, J. Johnson (eds.), “Quantifier Elimination and Cylindrical Algebraic Decomposition”, Springer-
Verlag 1998.
[2] G. E. Collins, “Quantifier Elimination for the Elementary Theory of Real Closed Fields by Cylindrical Alge-
braic Decomposition”, Lect. Notes Comput. Sci., 33, 1975, 134-183.
[3] G. E. Collins, “Quantifier Elimination by Cylindrical Algebraic Decomposition - Twenty Years of Progress”,
", in B. Caviness, J. Johnson (eds.), Quantifier Elimination and Cylindrical Algebraic Decomposition, Springer-
Verlag 1998, 8-23.
[4] G. E. Collins, H. Hong, "Partial Cylindrical Algebraic Decomposition for Quantifier Elimination", J. Sym-
bolic Comp., 12 (1991), 299-328.
[5] H. Hong, "An Improvement of the Projection Operator in Cylindrical Algebraic Decomposition", Proceedings
of ISSAC 1990, 261-264.
[6] S. McCallum, "An Improved Projection for Cylindrical Algebraic Decomposition of Three Dimensional
Space", J. Symbolic Comp., 5 (1988), 141-161.
[7] S. McCallum, "An Improved Projection for Cylindrical Algebraic Decomposition", in B. Caviness, J. Johnson
(eds.), Quantifier Elimination and Cylindrical Algebraic Decomposition, Springer-Verlag 1998, 242-268.
[8] S. McCallum, “Solving Polynomial Strict Inequalities Using Cylindrical Algebraic Decomposition”, The
Computer Journal, Vol. 36, No. 5, 1993, 432-438.
[9] D. Mitrinovic, J. E. Pecaric, V. Volenec, “Recent Advances in Geometric Inequalities” Kluwer Academic
Publishers, 1989.
[10] A. Strzebonski, “An Algorithm for Systems of Strong Polynomial Inequalities”, The Mathematica Journal,
vol. 4, iss. 4 (1994), 74-77.
W OLFRAM R ESEARCH I NC . AND JAGIELLONIAN U NIVERSITY, 100 T RADE C ENTRE D RIVE , C HAM -
PAIGN , IL 61820, U.S.A.
E-mail address: adams@wolfram.com