# Search Direction in Conjugate Gradient

Could you help me with a Conjugate Gradient question? In using CG to solve Ax=b, why is the search direction $p_{k+1}$ in CG chosen as a linear combination of the residual $r_k$ and previous direction $p_k$? I know the set of search directions are supposed to be conjugate with respect to A. One way to generate such sets is using the eigenvectors of A, but this is very computationally expensive. Another way is to use modified Gram Schmidt, but this requires so much storage. Hence, we choose $p_{k+1}=-r_k+\beta p_k$... but why this choice?

• You want to choose the directions so that (i) they are easy to compute, i.e., no eigenvectors for example, and (ii) they do not require much memory storage. With the given linear combination, all you need to store is the previous search direction, the current residual, and the current search direction. Jan 17 '15 at 22:57
• Because it's easy to pick $\beta$ so that $p_{k+1}Ap_k$ is zero. Jan 17 '15 at 22:57
• "Why does this work" and "how did they come up with this" are two different questions, with frequently completely unrelated answers. For the latter, this paper may be of interest: epubs.siam.org/doi/abs/10.1137/1031003?journalCode=siread Jan 18 '15 at 0:54
• To expand on Bill Barth's comment: The whole point of the CG method is to avoid the need to orthogonalize the new search direction against all previous directions; the key observation was that this is possible if one doesn't work with the standard Euclidean inner product but the one induced by the matrix $A$ (building on the work of Lanczos, who gave an algorithm to reduce a symmetric positive definite matrix to a tridiagonal matrix, which can be seen as a variant of Gram-Schmidt for the $A$-inner product). Jan 18 '15 at 1:10
• Is this useful? cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf Jan 21 '15 at 6:15