Computing 79, 153–162 (2007) DOI 10.1007/s00607-006-0194-y Printed in The Netherlands
Two blossoming proofs of the Lane-Riesenfeld algorithm E. Vouga and R. Goldman, Houston, TX Received December 1, 2006; revised April 8, 2006 Published online: March 7, 2007 © Springer-Verlag 2007 Abstract The standard proof of the Lane-Riesenfeld algorithm for inserting knots into uniform B-spline curves is based on the continuous convolution formula for the uniform B-spline basis functions. Here we provide two new, elementary, blossoming proofs of the Lane-Riesenfeld algorithm for uniform B-spline curves of arbitrary degree. AMS Subject Classifications: 65D07, 65D17. Keywords: Blossoming, B-splines, knot insertion, Lane-Riesenfeld algorithm.
1. Introduction Blossoming is a powerful tool for analyzing B-spline curves and surfaces [4], [10]– [12]. Most of the standard algorithms for B-splines, including algorithms for evaluation, differentiation, and conversion to piecewise Bezier form can be derived rather easily from blossoming [7]. General knot insertion algorithms such as Boehm’s algorithm [3], the Oslo algorithm [5], and factored knot insertion [1] are also readily derived from blossoming [2]. Yet till now there has been no blossoming proof of the Lane-Riesenfeld knot insertion algorithm for uniform B-spline curves of arbitrary degree. In fact, currently the only general proofs of the Lane-Riesenfeld algorithm are the original proof [9] based on the continuous convolution formula for the uniform B-spline basis functions and a complicated inductive argument [8] based on the deBoor algorithm. A straightforward blossoming proof of the Lane-Riesenfeld algorithm for uniform quadratic B-splines appears in [7]. With a bit of ingenuity it is possible to extend this blossoming proof to uniform cubic and uniform quartic B-spline curves, but it is not so clear how to extend this proof to uniform B-splines of arbitrary degree. The purpose of this paper is to provide elementary blossoming proofs of the Lane-Riesenfeld algorithm for B-spline curves of arbitrary degree. In fact, we shall provide two such blossoming proofs: one based on induction from above, the other on induction from below.
154
E. Vouga and R. Goldman
2. Blossoming When analyzing B-splines it is often convenient to work in the dual space, and blossoming is a convenient way to represent dual functionals for B-splines. The blossom of a degree n polynomial P (t) is the unique polynomial in n variables p(u1 , u2 , . . . , un ) satisfying the following three properties: (i) symmetry: p is invariant under permutations of its parameters. (ii) multiaffine: p ((1 − α)u11 + αu12 , u2 , . . . , un ) = (1 − α)p(u11 , u2 , . . . , un ) + αp(u12 , u2 , . . . , un ). (iii) diagonal: p(t, t, . . . , t) = P (t). A spline S(t) of degree n with m knots {ti } is composed of m − n + 1 polynomial pieces S1 (t), S2 (t), . . . , Sm−n+1 (t). The blossom s(t) of the spline S(t) is the set of m − n + 1 polynomial blossoms s1 (t), s2 (t), . . . , sm−n+1 (t), referred to collectively as the blossom of S(t). These spline blossoms evaluated at the knots represent the dual functionals for the B-splines: if si is the blossom for the polynomial Si on the knot interval (ti+n , ti+n+1 ), then for i ≤ j ≤ i + n, si (tj +1 , . . . , tj +n ) = Pj , where Pj is the j -th B-spline control point of S(t). This dual function property allows us to define s(tj +1 , . . . , tj +n ) = si (tj +1 , . . . , tj +n ), for any i such that i ≤ j ≤ i + n. 3. The Lane-Riesenfeld algorithm Given a set of control points {Pi } for a B-spline curve with a uniform knot sequence {ti }, the Lane-Riesenfeld algorithm allows us to insert new knots simultaneously at the midpoint of each pair of consecutive knots. Let S(t) be a spline of degree n with knots at the integers and let Pi be the i-th B-spline control point of S(t) for 0 ≤ i ≤ m for some integer m. Define Q0j = Pj , Qkj =
+ Qk−1 Qk−1 j j +1/2 2
k > 0,
where j takes values at the half-integers between 0 and
2m+1 2
(3.1) inclusive (see Fig. 1).
Then the Lane-Riesenfeld algorithm asserts that the set of points Qnj , for j a halfinteger, 0 ≤ j ≤
2m+1−n , 2
are the new B-spline control points on the subdivided
knot sequence – that is, S(t) =
2m+1−n
Qni/2 N(i+n)/2,n (t),
i=0
where {Nk,n (t)} are the uniform B-spline basis functions with knots at the halfintegers. The Lane-Riesenfeld algorithm has a blossoming interpretation: let s(u1 , . . . , un ) be the blossom of S(t). Then by the dual function property of the blossom,
Two blossoming proofs of the Lane-Riesenfeld algorithm
155
Fig. 1. The Lane-Riesenfeld algorithm for cubic B-splines with uniform knots and m = n = 3. The bottom row of this truncated pyramid consists of the original control points doubled, and the new control points lie along the top row. Each interior node represents an average of two nodes on the previous level
Fig. 2. The blossoming interpretation of the Lane-Riesenfeld Algorithm for quadratic B-splines
Pi = s(ti+1 , . . . , ti+n ), and the Lane-Riesenfeld algorithm asserts that Qni = s(ti+1+ n2 , . . . , ti+n+ n2 ), where ti+ 1 = 2
ti +ti+1 2 .
It is easy to use blossoming to show that the Lane-Riesenfeld algorithm correctly inserts knots in a uniform quadratic B-spline (see Fig. 2). Here, as expected, two rounds of averaging of the doubled control points yield the control points of the same B-spline curve with knots at the half-integers. The proof of the Lane-Riesenfeld algorithm for B-splines of higher degree is not so simple. In this paper we give two proofs, both based on blossoming, of the LaneRiesenfeld algorithm for uniform B-splines of arbitrary degree. The first proof is based on induction from above; the second on induction from below.
4. Blossoming proofs of the Lane-Riesenfeld algorithm 4.1. First approach: Induction from above We begin with an explicit formula for the points Qnj defined by the recurrence in Eq. (3.1). Lemma 4.1: Qnj
=
j +n/2 k=j
n+1 n+2j −2k Pk . 2n
156
E. Vouga and R. Goldman
Proof: The proof of this lemma follows easily by induction from Eq. (3.1) and the recurrence in Pascal’s Triangle. We now prove the Lane-Riesenfeld algorithm: Theorem 4.2: The Lane-Riesenfeld algorithm holds for splines of all degrees. Proof: We proceed by induction on the degree d of the spline. The case d = 1 is obvious and the case d = 2 is demonstrated in Fig. 2; thus we consider d > 2. The induction argument is slightly different for even and odd degrees, so we will present the proof for even degrees only, and leave odd degrees to the reader. Assume the theorem holds for splines of degree 2n − 1, and let S(t) be a spline of degree 2n with control points Pi and blossom s(u1 , . . . , u2n ). We will give a detailed proof only for 2n 2n Q2n 0 ; the proof for Qj requires only simple shifting of indices. To prove that Q0 is
a B-spline control point, we need to show that n 2n+1 2n−2k s(n + 1/2, . . . , 2n − 1/2, 2n) = s(k + 1, . . . , k + 2n) = Q2n 0 . 22n k=0
Consider the polynomial P ∗ (t) given by s(t, . . . , t, 2n); that is, the polynomial resulting from holding the last parameter of S’s blossom constant at 2n. Clearly P ∗ has degree 2n−1 and the blossom of P ∗ (t) is p∗ (u1 , . . . , u2n−1 ) = s(u1 , . . . , u2n−1 , 2n). Hence by the inductive hypothesis applied to P ∗ (t) and by Lemma 4.1 n 2n 2n−2k s(n + 1/2, . . . , 2n − 1, 2n − 1/2, 2n) = s(k + 1, . . . , k + 2n − 1, 2n) 22n−1 =
k=0 Q∗1/22n−1 .
(4.1)
Consider the identities 2n − k k k+ (k + 2n), (4.2) 2n 2n k+1 2n − k − 1 2n = (k + 1) + (k + 2n + 1). (4.3) 2n 2n Substituting the first of these identities into s(k + 1, . . . , k + 2n − 1, 2n), and the second identity into s(k + 2, . . . , k + 2n, 2n), applying the multiaffine property, and rearranging the sum on the right-hand side of Eq. (4.1) for Q∗ , yields 2n 2n n k + 1 2n−2−2k 2n − k 2n−2k s(n + 1/2, . . . , 2n − 1/2, 2n) = + 2n 2n 22n−1 22n−1 2n =
k=0
=
n
× s(k + 1, . . . , k + 2n) 2n+1
k=0
= Q2n 0 ,
2n−2k 22n
s(k + 1, . . . , k + 2n)
Two blossoming proofs of the Lane-Riesenfeld algorithm
157
2n completing the proof for Q2n 0 . The proof for Qj requires only a simple shift of indices.
This completes the induction for even degree; the induction for odd degree is similar and is left to the reader. 4.2. Second approach: Induction from Below The proof of the Lane-Riesenfeld algorithm by induction from above works, but it is hard to discern any direct connection between this proof and the algorithm. Therefore we shall now give a second blossoming proof of the Lane-Riesenfeld algorithm by applying an argument by induction from below that is more clearly tied to the algorithm. To prove the Lane-Riesenfeld algorithm using induction from below, we shall modify the initial blossom values so that the inductive hypothesis is reproduced after one level of averaging. This approach can be depicted as a pyramid diagram similar to Lane-Riesenfeld diagram (see Fig. 3). We will now describe the nature of Pi and Pi , as well as prove that the values at the apex of this diagram are identical to the values at the apex of the Lane-Riesenfeld pyramid. Let A(b0 , b1 , . . . , bn ) denote the repeated average of the values bi ; that is, A(b0 ) = b0 , A(b0 , b1 , . . . , bn ) = A
b0 + b1 b1 + b2 bn−1 + bn , ,... , 2 2 2
.
(4.4)
Then it follows easily from Pascal’s Recurrence that A(b0 , b1 , . . . , bn ) =
1 2(n−1)
n n bi . i
(4.5)
i=0
Fig. 3. The modified Lane-Riesenfeld Algorithm for quartic B-splines. Here some of the nodes Pi have been split into two new values Pi and Pi , which are used in the edge computations instead of Pi
158
E. Vouga and R. Goldman
Lemma 4.3: Let bi (t) = ct + d be a linear function. Then b0 + b1 bi−1 + bi (t + n − i) A(b0 , . . . , bi (t), . . . , bn ) = A ,... , , 2 2 bi (t − i) + bi+1 bn−1 + bn ,... , . 2 2
(4.6)
That is, on the first level of averaging we may split an arbitrary value into two related values that vary in one parameter. Proof: Using Eqs. (4.4) and (4.5) for A, we need only show n − 1 bi (t) + bi+1 n − 1 bi−1 + bi (t) + 2 i 2 i−1 n − 1 bi−1 + bi (t + n − i) n − 1 bi (t − i) + bi+1 = + . i−1 2 i 2 The terms involving bi−1 and bi+1 are common to both expressions and hence can be ignored. On the left-hand side we have left n − 1 bi (t) 1 n n − 1 bi (t) + = bi (t) i−1 2 i 2 2 i by Pascal’s Recurrence. Notice also that n−1 n−i (n − 1)! n−i n−1 = = , i−1 i (n − i)!(i − 1)! i i so
n−1
n−1
i−1
i
(n − i) =
(i). Hence, again by Pascal’s Recurrence,
n n−1 n−1 t= (t + n − i) + (t − i). i i−1 i Therefore since bi is linear, 1 n n − 1 bi (t − i) n − 1 bi (t + n − i) bi (t) = + . 2 i 2 i 2 i−1 Lemma 4.4: On one level of averaging arbitrarily many pairwise-nonconsecutive values may be split as in Lemma 4.3. Proof: In the proof of Lemma 4.3, all terms involving bj for 0 ≤ j < i − 1 and i + 1 < j ≤ n were left untouched, so by applying identical arguments inductively we may split as many values as desired.
Two blossoming proofs of the Lane-Riesenfeld algorithm
159
We now apply Lemma 4.4 to the doubled control points of the Lane-Riesenfeld algorithm to unveil an inductive proof of the subdivision algorithm. Specifically, we split the last parameter (in the manner described above) of the first occurrence of each repeated blossom value. For example, if s is a quartic blossom and we have the initial doubled control points {s(1, 2, 3, 4), s(2, 3, 4, 5), s(2, 3, 4, 5), s(3, 4, 5, 6), s(3, 4, 5, 6)} , we could apply the first iteration of averaging to yield s(1, 2, 3, 4) + s(2, 3, 4, 5) s(2, 3, 4, 5) + s(3, 4, 5, 6) , s(2, 3, 4, 5), , s(3, 4, 5, 6) . 2 2 But equivalently we may apply the identity in Eq. (4.6) to the last parameter of the first occurrence of each repeated control point to yield s(1, 2, 3, 4) + s(2, 3, 4, 5 + 4 − 1) s(2, 3, 4, 5 − 1) + s(2, 3, 4, 5) , , 2 2 s(2, 3, 4, 5) + s(3, 4, 5, 6 + 4 − 3) s(3, 4, 5, 6 − 3), s(3, 4, 5, 6) , , 2 2 which simplifies to 9 9 9 9 s 2, 3, 4, , s 2, 3, 4, , s 3, 4, 5, , s 3, 4, 5, . 2 2 2 2 Ignoring the last parameter which each blossom now has in common, we have the
cubic Lane-Riesenfeld algorithm, which reduces to s 3, 27 , 4, 29 by the inductive hypothesis. Theorem 4.5: The Lane-Riesenfeld algorithm of degree n holds for all n. Proof: The base case n = 2 has already been proved, so we assume n > 2 and proceed by induction on n. Let s be a blossom of degree n, and consider the case where the first two values of the doubled control points are identical. Then for some constant a, the n + 1 doubled control points are s(a, a +1, . . . , a +n − 1), s(a, a +1, . . . , a +n−1), s(a + 1, a + 2, . . . , a + n), . . . If we index the doubled control points from 0 to n, the i-th doubled control point is given by i i i s a+ ,a + + 1, . . . , a + +n−1 . 2 2 2 We now apply Eq. (4.6) to the last parameter of the first occurence of each repeated control point. In doing so we will compute two types of averages: the first type will be an average of two identical control points, the first of which has had one parameter modified as in the lemma, and the second type will be an average of two consecutive
160
E. Vouga and R. Goldman
control points, the second of which has had one parameter modified. For the first case, that average is 1 i i i s a+ ,a + + 1, . . . , a + +n−1 −i 2 2 2 2
i+1 i+1 i+1 +s a+ ,a + + 1, . . . , a + +n−1 2 2 2 i i i i i =s a+ ,a + + 1, . . . , a + + n − 2, a + +n−1− . 2 2 2 2 2 For this first case i must be even, so 2i = i+1 2 , justifying the above computation. Moreover, 2i = 2i , so the last parameter becomes a + n − 1, which is independent of i. The second case is similar, and the last parameter of the blossom is once again a + n − 1. Thus all the new blossoms have the last parameter a +n−1 in common, and a +n−1 is also the correct last parameter for the blossom that is the output of the LaneRiesenfeld algorithm on the original doubled control points. The other n−1 parameters of the new blossoms computed above are precisely the doubled control points for the Lane-Riesenfeld algorithm of degree n − 1, so treating the last parameter in all the blossoms as constant and applying the inductive hypothesis finishes the proof. The proof when the first two initial doubled control points are not identical is very similar and is left to the reader.
5. Conclusions and an open question By presenting two blossoming proofs of the Lane-Riesenfeld knot insertion algorithm for uniform B-spline curves of arbitrary degree we have filled in one of the last conspicuous gaps in the theory of blossoming and B-splines. All the well-known knot insertion algorithms – Boehm’s algorithm, the Oslo algorithm, factored knot insertion, and the Lane-Riesenfeld algorithm – can now be proved in a straightforward manner using blossoming. Nevertheless, there is still one lesser known knot insertion algorithm for which there is as yet no blossoming proof. This knot insertion algorithm is an extension of the Lane-Riesenfeld algorithm to knots in geometric progression [8]. Let S(t) be a spline of degree n with control points {Pi } and knots {tj }. Suppose that tj = β 2j for some constant β = 1 – that is, suppose that the knots are in geometric progression. (Recall that in the standard version of the Lane-Riesenfeld algorithm
Two blossoming proofs of the Lane-Riesenfeld algorithm
161
Fig. 4. The extension of the Lane-Riesenfeld algorithm to knots in geometric progression has the same structure as the standard Lane-Riesenfeld algorithm for knots in arithmetic progression (compare to Fig. 1). However, for knots tj = β 2j in geometric progression instead of using the arithmetic average to k−1 β k Qk−1 j +Qj +1/2
compute the value at each node Qkj , k > 0, these values are computed by setting Qkj =
1+β k
.
To avoid cluttering the diagram, the denominators have been suppressed
s b,b 2
b s 1,b 2
s b 2 ,b 3
b2
l
s 1,b 2
2 s b ,
b2
l
b(1 + b 3) 1+b
l
s b 3 ,b 4
b
l
l
s b 2 ,b 4
b
2 4 s b ,b
s 1,b 2
b2 4 s b ,
l
b 3 (1 + b 3) 1+b
b
2 4 s b ,b
l 4 6 s b ,b
Fig. 5. The blossoming interpretation of the extension of the Lane-Riesenfeld algorithm to knots in geometric progression for quadratic B-spline curves
the knots are in arithmetic progression.) Define Q0j = Pj , Qkj =
+ Qk−1 β k Qk−1 j j +1/2 1 + βk
k > 0,
where j takes on values at the half-integers. Then the points Qnj , for j a half integer, are the B-spline control points for the same curve relative to the knot sequence {τk }, where τk = β k . That is, Qni/2 N(i+n)/2,n (t), S(t) = i
where Ni,n (t) are the B-spline basis functions for the knots at τk = β k (see Fig. 4). For quadratic B-splines the proof of this result by blossoming is once again straightforward (see Fig. 5), but currently the only general proof of this algorithm for B-spline curves of arbitrary degree is based on the de Boor algorithm and a rather complicated induction [8].
162
E. Vouga and R. Goldman: Two blossoming proofs of the Lane-Riesenfeld algorithm
The blossoming proofs that we have presented for the standard version of the LaneRiesenfeld algorithm for knots in arithmetic progression fail to extend to knots in geometric progression. Our first proof, induction from above, breaks down because here we used the fact that Qnj
=
+ Qn−1 Qn−1 j j +1/2 2
2j2+n
⇒
Qnj
=
k= j +1 2
n+1 n+2j −2k Pk 2n
– that is, we used the fact that the recurrence for the points {Qkj } leads to an explicit expression for each point Qkj . We know of no comparable explicit formula for the points Qkj when the knots are in geometric progression. Our second proof, induction from below, breaks down because the new recurrence relation for Qkj does not lend itself to the splitting identity detailed in Eq. (4.6) of Lemma 4.3. Thus it is still an open problem to find a blossoming proof of the extension of the Lane-Riesenfeld algorithm to knots in geometric progression.
References [1] Barry, P., Goldman, R.: Factored knot insertion. In: Knot Insertion and Deletion Algorithms for B-spline Curves and Surfaces (R. Goldman and T. Lyche, eds). 1993, pp. 65–88. [2] Barry, P., Goldman, R.: Knot insertion algorithms. In: Knot Insertion and Deletion Algorithms for B-spline Curves and Surfaces (R. Goldman and T. Lyche, eds). 1993, pp. 89–133. [3] Boehm, W.: Inserting new knots into B-spline curves. Computer Aided Geometric Design 12, 199– 201 (1980). [4] de Casteljau, P.: Formes a poles. Hermes 1985. [5] Cohen, E., Lyche, T., Riesenfeld, R.: Discrete B-splines and subdivision techniques in computer aided geometric design and computer graphics. Computer Graphics Image Processing 14, 87–111 (1980). [6] Goldman, R.: Blossoming and knot insertion algorithms for B-spline curves. Computer Aided Geometric Design 7, 69–81 (1990). [7] Goldman, R.: Pyramid Algorithms: A dynamic programming approach to curves and surfaces for geometric modeling. San Diego: Morgan Kaufmann Publishers/Academic Press 2002. [8] Goldman, R., Warren, J.: An extension of Chaikin’s Algorithm to B-spline curves with knots in geometric progression. CVGIP: Graphics Models and Image Processing 55, 58–62 (1993). [9] Lane, J., Riesenfeld, R.: A theoretical development for the computer generation and display of piecewise polynomial surfaces. IEEE Trans. on Pattern Anal. and Mach. Intell. 2, 35–46 (1980). [10] Ramshaw, L.: Blossoming: A connect-the-dots approach to splines. SRC Research Report 19 (1987). [11] Ramshaw, L.: Beziers and B-splines as multiaffine maps. In: Theoretical foundations of computer graphics and CAD (R. A. Earnshaw, ed.) NATO ASI Series F, vol. 40. New York: Springer 1988, pp. 757–776. [12] Ramshaw, L.: Blossoms are polar forms. Computer Aided Geometric Design 6, 323–358 (1989).
E. Vouga and R. Goldman Department of Computer Science Rice University Houston, TX 77005 USA e-mail: rng@cs rice.edu