We prove that for any Fano manifold X , the special R-test configuration that minimizes the H NAfunctional is unique and has a K-semistable Q-Fano central fiber .W; /. Moreover there is a unique K-polystable degeneration of .W; /. As an application, we confirm the conjecture of Chen, Sun and Wang about the algebraic uniqueness for Kähler-Ricci flow limits on Fano manifolds, which implies that the Gromov-Hausdorff limit of the flow does not depend on the choice of initial Kähler metrics. The results are achieved by studying algebraic optimal degeneration problems via new functionals for real valuations over Q-Fano varieties, which are analogous to the minimization problem for normalized volumes.14J45, 32Q26, 53E30 1. Introduction 539 2. Preliminaries 544 3. H NA invariant and MMP 564 4. A minimization problem for real valuations 570 5. Initial term degeneration of filtrations 575 6. Uniqueness of minimizing special R-test configurations 578 7. Cone construction and g-normalized volume 580 8. Uniqueness of polystable degeneration 583 Appendix. Properties of z S .v/ 585 References 589