http://www.slash-zero.jp/archives/program/466
http://www.slash-zero.jp/archives/program/468
http://www.slash-zero.jp/archives/program/476http://hp.vector.co.jp/authors/VA007799/viviProg/doc5.htm
â Diffã¨ã¯ä½ã
æè¦çã«ã¯ç解ã§ããDiffã ããå³å¯ãªã¢ã«ã´ãªãºã ã¨ãã¦ã®Diffã¨ã¯ä½ãã説æãããAã¨Bã®Diffã¨ã¯ã
Aã¨Bã®ãæãå ±éé¨åãé·ããªãçµã¿åãã(LCS)ããè¦ã¤ããä½æ¥
ã¾ãã¯ã
è¦ç´ ã®è¿½å /åé¤ã®ã¿ã®æä½ã§ããæãå°ãªãæä½ã§AããBãä½æããæé (SED)ããè¦ã¤ããä½æ¥
â¦â¦ã§ããã
(以ä¸ã®ï¼ã¤ã¯å¥ã®ã¢ã«ã´ãªãºã ã§ãããçµæã¯ç°ãªãå ´åããã)ããã§ã¯ããæãå°ãªãæä½ã§AããBãä½æããæé (SED)ããè¦ã¤ããã¢ã«ã´ãªãºã ã«ã¤ãã¦è¨è¿°ããã
ãæãå°ãªãæä½ã§AããBãä½æããæé (SED)ããæ±ããããã«ã¯ãã¨ãã£ããã°ã©ãã¨ããã°ã©ããå©ç¨ããèãæ¹ã使ãããã
ã¨ãã£ããã°ã©ãã¯ã
縦軸ã«Aã®è¦ç´ ãã横軸ã«Bã®è¦ç´ ã並ã¹ã¦æ ¼åç¶ã®ã°ã©ããä½ãã
ããããã®ã縦軸ã®è¦ç´ = 横軸ã®è¦ç´ ãã§ãããã¤ã³ãã§ããã®ãã¤ã³ãã¨å·¦ä¸ã®ãã¤ã³ããæç·ã§çµã¶ã
ã¨ããæé ã§ä½æããããå³ã¯ http://www.slash-zero.jp/archives/program/466 åç §ã
ãã®ã°ã©ãä¸ã§ã
å³ã¸é²ããã¨ã¯ãBãããAã«ç¡ãè¦ç´ ãåé¤ããããã¨ã§ãã
ä¸ã¸é²ããã¨ã¯ãAãããBã«ç¡ãè¦ç´ ãåé¤ããããã¨ã§ãã
æç·ãé²ããã¨ã¯ãä¸è´ããç®æãèµ°æ»(ãªã«ãããªã)ããããã¨ã§ãã
â¦â¦ä»¥ä¸ããã
ã¨ãã£ããã°ã©ãã§å·¦ä¸ããå³ä¸ã«ç§»åããæççµè·¯ãæ±ããä½æ¥ã
ããªãã¡ããæãå°ãªãæä½ã§AããBãä½æããæé (SED)ããæ±ããä½æ¥ã§ããã¨è¨ãããã¨ãã£ããã°ã©ãã®æççµè·¯ãæ±ããã¢ã«ã´ãªãºã ã¯ããã¤ãåå¨ããã
â å ¨èµ°æ»ã¢ã«ã´ãªãºã
ã¨ãã£ããã°ã©ãã®å ¨çµè·¯ãèµ°æ»ãã¦æå°ã³ã¹ãã®çµè·¯ãæ±ããæ¹æ³ãâ O(ND)ã¢ã«ã´ãªãºã
(ã¾ã )â O(NP)ã¢ã«ã´ãªãºã
(ã¾ã )â åèª
LCS = LargestCommonSubsequence
ãæãå ±éé¨åãé·ããªãçµã¿åãããSED = ShortestEditDistance
ãæãå°ãªãæä½ã§AããBãä½æããæé ãO(ND)ã¢ã«ã´ãªãºã
Diffã®ã¢ã«ã´ãªãºã ã®ååï¼ E.W.Myers æ°ãèããããããO(NP)ã¢ã«ã´ãªãºã
Diffã®ã¢ã«ã´ãªãºã ã®ååï¼ S.W.maner, G.Myers, W.Miller æ°ãèãããããã