<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Comparison of steepest descent method and conjugate gradient method</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Oleksandra Osadcha</string-name>
          <email>oleosa338@student.polsl.pl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zbigniew Marszaek</string-name>
          <email>Zbigniew.Marszalek@polsl.pl</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Applied Mathematics, Silesian University of Technology</institution>
          ,
          <addr-line>Gliwice</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Institute of Mathematics, Silesian University of Technology</institution>
          ,
          <addr-line>Gliwice</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>-This paper illustrates comparison of two methods, which are used for solving systems of linear equations . The aim of the research is to analyze, which method is faster solve this equations and how many iteration required each method for solving. This paper presents some ways to deal with this problem. Also there are analyzed two methods. The first of them minimizes the standard deviation of the next iteration of the solution, the other constructs orthogonal vectors and is theoretically finite method.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Index Terms—conjugate gradient method, steepest descent
method, comparison, analysis</p>
    </sec>
    <sec id="sec-2">
      <title>I. INTRODUCTION</title>
      <p>Computer algorithms are important methods for numerical
processing. In all implementations it is important to make
them more efficient and decrease complexity but without
loss of efficiency. Cryptographic algorithms are one of most
important methods for computer science therefore efficiency
and complexity of these is crucial for optimal processing
[14]. Knowledge systems demand fast and precise methods
for information processing [4], [6]. Similarly decision support
models need devoted techniques for lower complexity [12].</p>
      <p>This publication present comparison of steepest descent
method and conjugate gradient method. These methods are
used for solving systems of linear equations. In our
publication, we analyze, which method is faster and how many
iteration required each method. First, we describe these methods,
than we compare them and make conclusions.</p>
      <p>II. THE STEEPEST DESCENT METHOD</p>
      <p>The steepest descent method formulated by Stiefel. We will
present the mathematical description of the method of steepest
descent and we will make implementation in the form of code.
Consider the system linear equations in the general form</p>
      <p>
        Ax = B
We suppose that matrix A is symmetric and positive definite.
With x we denote solution of the system equations 1, i.e.:
Ax = b. The methods of gradient constructed a sequence of
successive approximations to determine the solutions x with
using formula:
x(k+1) = x(k) + ckr(k)
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
      </p>
      <p>Occurring in the equation 2 vector r(k) is called residuum of
system and takes the following form:
r(k) = b</p>
      <p>Ax(k);
or
r(k+1) = r(k)
ckAr(k) = (I
ckA)r(k):</p>
      <p>In iterative process this vector can be determined in each
iteration of the algorithm as a suitable combination of the
previous values, as described is in next formula:
r(k+1) = r(k)
ckAr(k)
The coefficients ck iterations occurring in the equation 3 are
determined on the basis of the following equality:
kx
x(k+1)kB = icnkf kx
x(k)
ckr(k)kB
In contrast, norm k kB is defined as</p>
      <p>def pxT Bx
kxkB =
Matrix B occurring in formula 7 is symmetric and positive
definite. At the same time it fulfills the condition the
alternation of the matrix A, i.e.: A B = b A. It is not difficult to show
that searched coefficients ck are described by the equation:
ck =
(r(k); B(x</p>
      <p>x(k)))
(r(k); Br(k))
:
Just for some matrix B, you can determine the value of B(x
x(k)). For example, if B = A(p), p 2 N then there is following
equality:</p>
      <p>A(p)(x
x(k)) = A(p 1)(b</p>
      <p>
        Ax(k)) = A(p 1)r(k): (
        <xref ref-type="bibr" rid="ref9">9</xref>
        )
Also it can be described in specific cases. For example, for
p = 1, method is called steepest descent, while p = 2 method
minimizes the Euclidean norm, and we call it the method of
least residuum, where
ck =
(r(k); Ar(k)))
(Ar(k); Ar(k))
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
(
        <xref ref-type="bibr" rid="ref7">7</xref>
        )
(
        <xref ref-type="bibr" rid="ref8">8</xref>
        )
(
        <xref ref-type="bibr" rid="ref10">10</xref>
        )
      </p>
      <p>III. CONJUGATE GRADIENT METHOD</p>
      <p>We use conjugate gradient method to solve the system of
linear equations given in the form of</p>
      <p>
        Ax = b;
(
        <xref ref-type="bibr" rid="ref11">11</xref>
        )
where A is a positive definite matrix with n
n sizes.As a
result of operation of this method we obtain a sequence of
vectors starting from a vector initial x0
x0 ! x1 !
! xn;
which stops after accurate calculations at most n steps, so
we get the required solution in the form of xn+1 = x.
Since the calculations performed occurs rounding error value,
so the value of xn+1 is generally not very accurate result.
Therefore, in this method, as in all other iterative methods
we conduct further steps xk ! xk+1, respectively, until we
get the exact solution. Since the amount of work at each step
of the workload of the matrix multiplication A by the vector,
and therefore this method is not suitable for use in the matrix
band and solid. In contrast, as much as possible, this method
is suitable for a medium-sized array diluted. The general
idea of our method is based on the fact that the functional
F : Rn ! R which has a form:
F (z) = 1 (b Az)T A 1(b Az) = 1 zT bT z Az+ 1 bT A 1b;
2 2 2
is minimized with accurate solution x, thus
0 = F (x) = min F (z):
z2Rn
This equality follows from the fact that the matrix A is positive
definite, and thus the matrix A 1 also has the same property.
While corresponding with the vector z residualny vector r :
Az = b, disappears only z := x. It reminds us that the
method of steepest descent in which a string of x1 ! x2 !
: : : is found with 1-dimensional minimize the functional F in
the direction of the gradient:
where
xk+1 : F (xk+1) = min F (xk + urk);
      </p>
      <p>u
rk := DF (xk)T = b</p>
      <p>Axk:
However, in the case of conjugate gradient method, we must
to carry out the minimization of the k dimensions:
xk+1 : F (xk+1) =</p>
      <p>min F (xk + u1r1 +
u1;:::;uk</p>
      <p>
        + ukrk);
ri := b Axi f or i k:
(
        <xref ref-type="bibr" rid="ref12">12</xref>
        )
It’s very easy to compute xk+1. In addition, vectors ri are
ortogonal, and hence lineary independent provided that rk 6=
0. Becouse, in space R, there are no more than n in depended
vectors, so in exact calculations, there is the smallest k n+1
such that rk is equal zero. Vector xk corresponds to number
rk. Now we well show step k xk ! rk+1 of our method. The
matrix dimensions n k we denote Rk,
      </p>
      <p>Rk := (r1; r2; : : : ; rk):
With the k-dimensional minimilizing point in formula 11 are
allowed all vectors from z being in the form of
z = xk + Rku;
u 2 Rk;
where r = rk + ARku is residual vector. Hence,
F (z) = 1 rT A 1r = 21 rkT A 1rk + uT RkT rk + 1 uT RkT ARku:
2 2
Differentiating our functional by u, functional adopts a
minimum for
where ue 2 Rk is solution to the equation
We introduce the following designations
xk+1 = xk + Rkue;
RkT ARkue =</p>
      <p>RkT rk:
2 0 3
66 ... 77
66 0 77
RT ARvk = 66 77
6 7
6 7
664 ... 775</p>
      <p>R := (r1; : : : ; rk; : : : ; rn);
Then we get Rvk = Rkue, and</p>
      <p>
        xk+1 = xk + Rkue = xk + Rvk;
rk+1 = rk + ARkue = rk + ARvk:
From the above fact follows that: 1. RkT rk+1 = 0 by (
        <xref ref-type="bibr" rid="ref12">12</xref>
        ),
after that we have ortogonal vector rk+1 to vectors r1; : : : ; rk.
Thus the right-hand side of equation (
        <xref ref-type="bibr" rid="ref12">12</xref>
        ) is as follows:
(
        <xref ref-type="bibr" rid="ref13">13</xref>
        )
(
        <xref ref-type="bibr" rid="ref14">14</xref>
        )
(15)
:
(16)
2. If vector rk 6= 0, then vectors r1; : : : ; rk are linearly
independent, but matrix RkT ARk is positively determined.
Thereafter, RkT rk 0 hence to the equation (
        <xref ref-type="bibr" rid="ref11">11</xref>
        ) and (
        <xref ref-type="bibr" rid="ref14">14</xref>
        )
0 &lt; ueT RkT ARkue =
uT RkT rk;
e
where last component in vector u, and therefore k-th
compoe
nent of the vector vk is negative.
3. In view of equations (
        <xref ref-type="bibr" rid="ref13">13</xref>
        ) and (15) for i &lt; k we have next
equality:
(xi+1
xi)T A(xk+1
xk) = viT [RT ARvk] =
2 0 3
66 ... 77
66 0 77
; 0; : : : ; 0) 6666 7777
664 ... 775
it is mean, that directions pi := xi+1 xi are A-coupled:
piT Apk = 0 for i &lt; k.
4. In view of equations (
        <xref ref-type="bibr" rid="ref12">12</xref>
        ), (1.1.13) and (1.1.14) we have
next equality
      </p>
      <p>F (xk+1) = 21 rkT+1A 1rk+1 = 21 rkT A 1rk + ueT RkT rk+
+ 1 uT RkT ARkue = F (xk)
2 e
1 uT RkT ARkue =
2 e
1
= F (xk) 2 (xk+1 xk)T A 1(xk+1 xk):
This formula explains the extend of decrease value of
functional F in k-th step xk ! xk+1</p>
      <p>
        5. If vector vk = (v1; : : : ; vk; 0; : : : ; 0)rk 6= 0 has k
components, where rk 6= 0 is negative. From formula (
        <xref ref-type="bibr" rid="ref14">14</xref>
        )
follows next equality
rk+1
rk = ARvk =
k
X vj Arj ;
j=1
k 1
X vj Arj )=vk:
j=1
rk+1)
ek(rk 1
      </p>
      <p>rk)
rj+1);
(e1 := 0)
(18)
then</p>
      <p>Ark = ((rk+1</p>
      <p>rk)
Ark = qk+1(rk
k 2
X cj (rj
j=1
Applying induction we get description for Ark in following
form
where qk+1, ek are constans and additionally qk+1 = 1=vk &gt;
0. By solving the above equation due tork+1 we get the
equality:
k 2
rk+1 = rk +[ Ark +ek(rk rk 1)+X cj (rj+1 rj )]=qk+1:
j=1
(19)
If we take into account orthogonality of vectors
r1; : : : ; rk; rk+1, then we can easily demonstrate that all
the constants cj disappear. Thus, we obtain formulas for qk+1
i ek. Then, for k 2 1 we get
r1T rk+1 = 0 ) 0 = r1T Ark + c1r1T r1 = rkT (Ar1) + c1r1T r1:
(20)</p>
      <p>By using the formula (17), we can conclude that vector
Ar1 also is a linear combination of vectors r1 and r2, then
rkT Ar1 = 0 providing that k &gt; 2. Thus, from equality (18)
implies that c1 = 0.</p>
      <p>We assume, that for some j 1, which satisfying the
following inequality 1 j k 2, there is equality
c1 = c2 = = cj 1 = 0. Therefore, by using formula(18)
as before, we obtain:
rjT rk+1 = 0 ) 0 = rkT Arj + cj rjT rj =
= rkT (linear combination of vectors rj+1; rj ; : : : ; r1) +
cj rjT rj =</p>
      <p>cj rjT rj ) cj = 0, vectors r1; : : : ; rk are linearly
independent, as is apparent from the fact that r0 6= 0. In this
connection, in particular, we have rj 6= 0. Therefore, all solid
cj , where j = 1; : : : ; k 2 disappear in equations (17) and
(18). Due to the fact, we get
rkT 1rk+1 = 0 ) ek =
rkT rk+1 = 0 ) qk+1 =
rkT Ark 1 = qk rTrkT rk
rkT 1rk 1 k 1rk 1
rkT Ark</p>
      <p>This gives us an algorithm conjugate gradient method.
Initial data: x1 is intended, r1 := b Ax1; e1 := 0.
For k = 1; 2; : : : ; n: ]1) If rk = 0, stop; xk is sought for
solution. 2) Otherwise, we must to calculate:
qk+1 :=</p>
      <p>ek;
rkT Ark</p>
      <p>There is a big difference between presented methods. The
steepest descent method is several times faster than conjugate
gradient method. But, if we look on iteration of this methods
in Table.1, we see, that conjugate method converge after less
number of iteration. For example, for n = 20, number of
iterations of conjugate gradient method equals 65, and achieve
the desired accuracy - 1413.</p>
      <p>B. Analysis of time</p>
      <p>On graph of time, we can see that, for example, for n = 15
time in ms of conjugate gradient method equals 286 and time
in ti of steepst descent method equals 271. After that, we
could see, that when number of n increases there is substantial
difference between methods. For example, when n = 20, time
in ms of conjugate gradient method is equals 1680, time in ti
of achieve the desired accuracy - 1621 iterations.</p>
    </sec>
    <sec id="sec-3">
      <title>V. CONCLUSIONS</title>
      <p>We have compared two method implemented to solve
systems of linear equations. The steepest descent method is faster
method, because it solve equations in less amount of time.
Conjugate gradient method is slower, but more productive,
because, it converges after less iterations. So, we can see, that
one method can be used, when we want to find solution very
fast and another can be converge to maximum in less iteration.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>O.</given-names>
            <surname>Axelsson</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Lindskog On the Rate of Convergence of the Preconditioned Conjugate Gradient Method</article-title>
          , ,,Numerische Mathematik”,
          <year>1986</year>
          , nr 48, s.
          <fpage>499</fpage>
          -
          <lpage>523</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Mordecai</given-names>
            <surname>Avriel Nonlinear Programming</surname>
          </string-name>
          :
          <source>Analysis and Methods</source>
          ,
          <year>2003</year>
          ,
          <string-name>
            <given-names>Dover</given-names>
            <surname>Publishing</surname>
          </string-name>
          ,
          <source>ISBN 0-486-43227-0</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>D.</given-names>
            <surname>Połap</surname>
          </string-name>
          , M. Woz´niak, , C. Napoli, and E. Tramontana, “
          <article-title>Real-Time Cloud-based Game Management System via Cuckoo Search Algorithm”</article-title>
          <source>International Journal of Electronics and Telecommunications</source>
          , vol.
          <volume>61</volume>
          , No.
          <issue>4</issue>
          , pp.
          <fpage>333</fpage>
          -
          <lpage>338</lpage>
          ,
          <year>2015</year>
          , DOI: 10.1515/eletel-2015-0043.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>P.</given-names>
            <surname>Artiemjew</surname>
          </string-name>
          ,
          <source>Stability of Optimal Parameters for Classifier Based on Simple Granules of Knowledge</source>
          ,
          <source>Technical Sciences</source>
          , vol.
          <volume>14</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>57</fpage>
          -
          <lpage>69</lpage>
          . UWM Publisher,
          <year>Olsztyn 2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Knyazev</surname>
            ,
            <given-names>Andrew V.</given-names>
          </string-name>
          ;
          <article-title>Lashuk, Ilya Steepest Descent and Conjugate Gradient Methods with Variable Preconditioning</article-title>
          .
          <source>SIAM Journal on Matrix Analysis and Applications</source>
          .
          <volume>29</volume>
          (
          <issue>4</issue>
          ):
          <fpage>1267</fpage>
          . doi:
          <volume>10</volume>
          .1137/060675290
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Marszałek</surname>
          </string-name>
          , “Novel Recursive Fast Sort Algorithm,” in Communications in
          <source>Computer and Information Science</source>
          , vol.
          <volume>639</volume>
          , pp.
          <fpage>344</fpage>
          -
          <lpage>355</lpage>
          ,
          <year>2016</year>
          , DOI: 10.1007/978-3-
          <fpage>319</fpage>
          -46254-7
          <fpage>27</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>G.</given-names>
            <surname>Capizzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Bonanno</surname>
          </string-name>
          , C. Napoli, “
          <article-title>Hybrid neural networks architectures for SOC and voltage prediction of new generation batteries storage”</article-title>
          ,
          <source>International Conference on Clean Electrical Power (ICCEP)</source>
          , pp.
          <fpage>341</fpage>
          -
          <lpage>344</lpage>
          , IEEE,
          <year>2015</year>
          , DOI: 10.1109/ICCEP.
          <year>2011</year>
          .
          <volume>6036301</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>C.</given-names>
            <surname>Napoli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Bonanno</surname>
          </string-name>
          , G. Capizzi, “
          <article-title>An hybrid neuro-wavelet approach for long-term prediction of solar wind”</article-title>
          ,
          <source>Proceedings of the International Astronomical Union</source>
          , vol.
          <volume>6</volume>
          , no.
          <issue>274</issue>
          , pp.
          <fpage>153</fpage>
          -
          <lpage>155</lpage>
          , IAU,
          <year>2015</year>
          , DOI: 10.1017/S174392131100679X.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Yvan</given-names>
            <surname>Notay Flexible Conjugate Gradients</surname>
          </string-name>
          ,
          <year>2000</year>
          ,
          <source>SIAM Journal on Scientific Computing</source>
          .
          <volume>22</volume>
          (
          <issue>4</issue>
          ):
          <fpage>1444</fpage>
          . doi:
          <volume>10</volume>
          .1137/S1064827599362314
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>D.</given-names>
            <surname>Połap</surname>
          </string-name>
          , M. Woz´niak, , C. Napoli, and E. Tramontana, “Is swarm intelligence able to create mazes?”
          <source>International Journal of Electronics and Telecommunications</source>
          , vol.
          <volume>61</volume>
          , No.
          <issue>4</issue>
          , pp.
          <fpage>305</fpage>
          -
          <lpage>310</lpage>
          ,
          <year>2015</year>
          , DOI: 10.1515/eletel-2015-0039.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>C.</given-names>
            <surname>Napoli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Pappalardo</surname>
          </string-name>
          , E. Tramontana, “
          <article-title>An agent-driven semantical identifier using radial basis neural networks and reinforcement learning”, XV Workshop Dagli Oggetti agli Agenti (WOA), CEUR-WS</article-title>
          , vol.
          <volume>1260</volume>
          ,
          <year>2015</year>
          , DOI: 10.13140/2.1.1446.7843.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>D.</given-names>
            <surname>Połap</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Woz´niak, “Flexible Neural Network Architecture for Handwritten Signatures Recognition”</article-title>
          <source>International Journal of Electronics and Telecommunications</source>
          , vol.
          <volume>62</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>197</fpage>
          -
          <lpage>202</lpage>
          ,
          <year>2016</year>
          , DOI: 10.1515/eletel-2016-0027.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Jan</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Snymam Practical Mathematical Optimization</surname>
          </string-name>
          :
          <article-title>An Introduction to Basic Optimization Theory and Classical and New Gradient-Based Algorithms</article-title>
          ,
          <year>2005</year>
          , Springer Publishing, ISBN 0-387-24348-8
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>J.</given-names>
            <surname>Toldinas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Damasevicius</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Venckauskas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Blazauskas</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Ceponis</surname>
          </string-name>
          , “
          <article-title>Energy Consumption of Cryptographic Algorithms in Mobile Devices” ELEKTRONIKA IR ELEKTROTECHNIKA</article-title>
          , vol.
          <volume>20</volume>
          , pp.
          <fpage>158</fpage>
          -
          <lpage>161</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>