OSDN Git Service

refine formula, use aligned
authorMingqiHuang <hmq011212@163.com>
Wed, 29 Aug 2018 12:14:44 +0000 (20:14 +0800)
committerGitHub <noreply@github.com>
Wed, 29 Aug 2018 12:14:44 +0000 (20:14 +0800)
docs/dp/optimization.md

index 444f4fc..00ae358 100644 (file)
@@ -48,13 +48,16 @@ By [hsfzLZH1](https://github.com/hsfzLZH1)
 \r
 我们假设 $x=idx_{i+1,j},y=idx_{i,j+1}$。不妨设 $x<=y$。\r
 \r
-将 $x,y$ 带入得, $f_{i,j}+f_{i+1,j+1}=f_{i,x}+f_{x+1,j}+cost_{i,j}+f_{i+1,y}+f_{y+1,j+1}+cost_{i+1,j+1}$\r
+将 $x,y$ 带入得,$f_{i,j}+f_{i+1,j+1}=f_{i,x}+f_{x+1,j}+cost_{i,j}+f_{i+1,y}+f_{y+1,j+1}+cost_{i+1,j+1}$\r
 \r
 由于上一步已经证明出了$cost$满足四边形不等式,而该不等式的左边在上式出现过,将其替换得\r
 \r
-$f_{i,x}+f_{x+1,j}+cost_{i,j}+f_{i+1,y}+f_{y+1,j+1}+cost_{i+1,j+1}$\r
-\r
-$\le f_{i,x}+f_{x+1,j+1}+cost_{i,j+1}+f_{i+1,y}+f_{y+1,j}+cost_{i+1,j}$\r
+$$\r
+\begin{aligned}\r
+&&f_{i,\,x}+f_{x+1,\,j}+cost_{i,\,j}+f_{i+1,\,y}+f_{y+1,\,j+1}+cost_{i+1,\,j+1}\\\r
+&\le&f_{i,\,x}+f_{x+1,\,j+1}+cost_{i,\,j+1}+f_{i+1,\,y}+f_{y+1,\,j}+cost_{i+1,\,j}\\\r
+\end{aligned}\r
+$$\r
 \r
 消去公共项可得 $f_{i,j}+f_{i+1,j+1}\le f_{i+1,j}+f_{i,j+1}$\r
 \r