Slide 1

Slide 1 text

%J⒎FSFODF"MHPSJUIN :VZB)PSJUB(JU)VCIPSJUBZVZB5XJUUFSIPSJUB@ZVZB $ZCFS"HFOU *OD J04%$

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

"HFOEB *OUSPEVDUJPO w ࠩ෼ͱ͸ʁ w ฤूͱ͍͏ߟ͑ํ .ZFST"MHPSJUIN w 'FBUVSFT w 4&4-$41SPCMFN w &EJU(SBQI w ݪཧ w .ZFST0WFSWJFX 1BVM)FDLFM"MHPSJUIN w 'FBUVSFT w ݪཧ w )FDLFM0WFSWJFX 4VNNBSZ

Slide 4

Slide 4 text

*OUSPEVDUJPO

Slide 5

Slide 5 text

source = [1, 2, 3, 4, 5] ࠩ෼ͱ͸ʁ target = [1, 3, 5, 7] EJ⒎ TPVSDF UBSHFU

Slide 6

Slide 6 text

source = [1, 2, 3, 4, 5] ࠩ෼ͱ͸ʁ target = [1, 3, 5, 7] EJ⒎ TPVSDF UBSHFU %FMFUF %FMFUF *OTFSU

Slide 7

Slide 7 text

source = [1, 2, 3, 4, 5] ࠩ෼ͱ͸ʁ target = [1, 3, 5, 7] EJ⒎ TPVSDF UBSHFU %FMFUF %FMFUF *OTFSU &EJU4DSJQU

Slide 8

Slide 8 text

ฤूͱ͍͏ߟ͑ํ TPVSDF UBSHFU

Slide 9

Slide 9 text

ฤूͱ͍͏ߟ͑ํ TPVSDF UBSHFU EJ⒎ TPVSDF UBSHFU %FMFUF %FMFUF *OTFSU

Slide 10

Slide 10 text

.ZFST"MHPSJUIN

Slide 11

Slide 11 text

'FBUVSFT w 4JNQMF w 0 /% $PNQMFYJUZ w %FMFUF*OTFSU4DSJQU w 4IPSUFTU w "EPQUFEJO%J⒎6UJM IUUQTEFWFMPQFSBOESPJEDPNSFGFSFODFBOESPJETVQQPSUWVUJM%J⒎6UJM

Slide 12

Slide 12 text

࠷୹ͷ൑ఆ͸ʁ

Slide 13

Slide 13 text

࠷୹ͷఆྔత൑அ w 4&44IPSUFTU&EJU4DSJQU w -$4ɿ-POHFTU$PNNPO4VCTFRVFODF w &EJU4DSJQUTPVSDFˠUBSHFUͷฤूʹඞཁͳ*OTFSU %FMFUF4DSJQUͷ͜ͱ w 4VCTFRVFODFɿ഑ྻ͔Β͍͔ͭ͘ͷཁૉΛऔΓআ͍ͯಘΒΕΔ഑ྻ 4&4-$41SPCMFN

Slide 14

Slide 14 text

࠷୹ͷఆྔత൑அ w 4&44IPSUFTU&EJU4DSJQU w -$4ɿ-POHFTU$PNNPO4VCTFRVFODF w &EJU4DSJQUTPVSDFˠUBSHFUͷฤूʹඞཁͳ*OTFSU %FMFUF4DSJQUͷ͜ͱ w 4VCTFRVFODFɿ഑ྻ͔Β͍͔ͭ͘ͷཁૉΛऔΓআ͍ͯಘΒΕΔ഑ྻ source = [1, 2, 3, 4, 5] FY [1, 2, 5] [2, 3, 4, 5] [1, 2, 4, 3] [1, 3, 4, 6] 4&4-$41SPCMFN

Slide 15

Slide 15 text

࠷୹ͷఆྔత൑அ w 4&44IPSUFTU&EJU4DSJQU w -$4ɿ-POHFTU$PNNPO4VCTFRVFODF w &EJU4DSJQUTPVSDFˠUBSHFUͷฤूʹඞཁͳ*OTFSU %FMFUF4DSJQUͷ͜ͱ w 4VCTFRVFODFɿ഑ྻ͔Β͍͔ͭ͘ͷཁૉΛऔΓআ͍ͯಘΒΕΔ഑ྻ 4&4-$41SPCMFN ˞EVBMQSPCMFN source = [1, 2, 3, 4, 5] FY [1, 2, 5] [2, 3, 4, 5] [1, 2, 4, 3] [1, 3, 4, 6]

Slide 16

Slide 16 text

Ͳ͏΍ͬͯ୳ͦ͏

Slide 17

Slide 17 text

&EJU(SBQI ίϯϐϡʔλͰղ͚ͦ͏ͳײ͡ʹදݱ

Slide 18

Slide 18 text

&EJU(SBQI source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] ίϯϐϡʔλͰղ͚ͦ͏ͳײ͡ʹදݱ

Slide 19

Slide 19 text

source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] (0, 0) A B C A B B A C B A B A C 0 1 2 3 4 5 0 1 2 3 4 5 6 source target 4UBSU (7, 6) &OE

Slide 20

Slide 20 text

source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] (0, 0) A B C A B B A C B A B A C 0 1 2 3 4 5 0 1 2 3 4 5 6 source target NBUDIQPJOU QPJOUBTTBNFTZNCPM (7, 6) 4UBSU &OE

Slide 21

Slide 21 text

source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] (0, 0) A B C A B B A C B A B A C 0 1 2 3 4 5 0 1 2 3 4 5 6 source target NBUDIQPJOU QPJOUBTTBNFTZNCPM (7, 6) &EHFʹԊͬͯɺ4UBSU͔Β&OE·ͰҠಈ͢Δ ӈɾԼɾࣼΊํ޲ͷҠಈ㲈EFMFUF JOTFSU EPOPUIJOH 4UBSU &OE 4UBSU &OE

Slide 22

Slide 22 text

source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] (0, 0) A B C A B B A C B A B A C 0 1 2 3 4 5 0 1 2 3 4 5 6 source target NBUDIQPJOU QPJOUBTTBNFTZNCPM (7, 6) 4&4 4UBSU &OE 4UBSU࠲ඪ&OE࠲ඪͷ࠷୹ܦ࿏ 4UBSU &OE

Slide 23

Slide 23 text

(0, 0) 0 1 2 3 4 5 (7, 6) 0 1 2 3 4 5 6 Delete A Delete B 3JHIU.PWFNFOU #PUUPN.PWFNFOU %JBHPOBM.PWFNFOU EFMFUF JOTFSU EPOPUIJOH TBNFTZNCPM NBUDIQPJOU QPJOUBTTBNFTZNCPM Insert B Insert C source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] A B C A B B A C B A B A C target Delete B 4UBSU &OE source 4UBSU &OE

Slide 24

Slide 24 text

w&EJU(SBQIฤू࡞ۀΛίϯϐϡʔλͰղ͚ͦ͏ͳײ͡ʹදݱɻ wӈҠಈ%FMFUF wԼҠಈ*OTFSU wࣼΊҠಈEPOPUIJOH TBNFFMFNFOU 4&4-$41SPCMFNΛղ͘4UBSU࠲ඪ͔Β&OE࠲ඪ΁ͷ࠷୹ܦ࿏Λݟ͚ͭΔ

Slide 25

Slide 25 text

ݪཧ

Slide 26

Slide 26 text

ҠಈίετJT%JBHPOBM source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] (0, 0) 0 1 2 3 4 5 (7, 6) 0 1 2 3 4 5 6 Delete A Delete B NBUDIQPJOU QPJOUBTTBNFTZNCPM Insert B Insert C A B C A B B A C B A B A C target Delete B 4UBSU &OE ࠷୹ܦ࿏ͷ૯Ҡಈίετ % 4&4ͷεΫϦϓτ਺ source 4UBSU &OE

Slide 27

Slide 27 text

Myers Algorithm w%͔Β࢝Ίͯɺ&OE࠲ඪΛ໨ࢦ͢ wແཧͩͬͨΒɺ%Λ૿΍ͯ͠౸ணग़དྷΔ·Ͱ܁Γฦ͢ w ͍͚Δ͔ͳʁ͍͚Δ͔ͳʁ͍͚ ˞͋͘·Ͱɺ%ճͰ࠷ԕͷ࠲ඪΛ໨ࢦ͢ɻ ࣼΊҠಈ͸શͯফඅ

Slide 28

Slide 28 text

Lઢɿx - y = kͰ&EJU(SBQI্ʹͰ͖Δର֯ઢ

Slide 29

Slide 29 text

(0, 0) 0 1 2 3 4 5 (7, 6) 0 1 2 3 4 5 6 Delete A Delete B NBUDIQPJOU QPJOUBTTBNFTZNCPM Insert B Insert C source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] A B C A B B A source C B A B A C target Delete B 4UBSU &OE 3 1 x - y = k 0 -1 2 Y Z 4UBSU &OE

Slide 30

Slide 30 text

(0, 0) 0 1 2 3 4 5 (7, 6) 0 1 2 3 4 5 6 Delete A Delete B NBUDIQPJOU QPJOUBTTBNFTZNCPM Insert B Insert C source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] A B C A B B A source C B A B A C target Delete B 4UBSU &OE 3 1 x - y = k 0 -1 2 Y Z k + 1 k - 1 k 4UBSU &OE

Slide 31

Slide 31 text

(0, 0) 0 1 2 3 4 5 (7, 6) 0 1 2 3 4 5 6 Delete A Delete B NBUDIQPJOU QPJOUBTTBNFTZNCPM Insert B Insert C source = [A, B, C, A, B, B, A] target = [C, B, A, B, A, C] A B C A B B A source C B A B A C target Delete B 4UBSU &OE 3 1 0 -1 2 Y Z k + 1 k - 1 k ඇର֯ͳҠಈΛ%ճߦͬͨ࠷௕ͷܦ࿏ %͕ح਺ͳΒLح਺ͷର֯ઢ %͕ۮ਺ͳΒLۮ਺ͷର֯ઢ্Ͱࢭ·Δ 4UBSU &OE

Slide 32

Slide 32 text

For D ← 0 to M + N Do For k ← -D to D in steps of 2 Do Until D Path gets to furthest point Do Move on edges If (N, M) is the reached point Then Found the SES. Array[with: k] M = source.count N = target.count %͕ح਺ͳΒLح਺ͷର֯ઢ %͕ۮ਺ͳΒLۮ਺ͷର֯ઢ্Ͱࢭ·Δ &EJU(SBQI্Ͱ࠷ԕͷύε͸֎प Complexity: O((M+N)D) ίετ%Ͱߦ͚ͨ࠷ԕͷ࠲ඪΛLઢຖʹه࿥ %શͯԼҠಈ %શͯӈҠಈ &OE࠲ඪ

Slide 33

Slide 33 text

.ZFST0WFSWJFX w 4&4-$41SPCMFNΛղͨ͘ΊͷΞϧΰϦζϜ w &EJU(SBQI w Ҡಈίετ % ɾLઢͷ֓೦Λ׆༻ w %FMFUF *OTFSUऔಘޙɺͦΕΛ.PWF 6QEBUF4DSJQUʹม׵͢Δ ͜ͱ͸Մೳ

Slide 34

Slide 34 text

1BVM)FDLFM"MHPSJUIN

Slide 35

Slide 35 text

w 4JNQMF0QUJNJ[BCMF w 0 / $PNQMFYJUZ w %FMFUF *OTFSU .PWF4DSJQU w /PU"MXBZT4IPSUFTU w #BTFPG 'FBUVSFT 3Y%BUB4PVSDFT

Slide 36

Slide 36 text

ݪཧ

Slide 37

Slide 37 text

TPVSDF UBSHFU 4ZNCPM5BCMF &MFNFOU DPVOUJOTPVSDF DPVOUJOUBSHFU JOEFYJOTPVSDF OVMM OVMM source = [1, 2, 3, 4, 5, 4] target = [1, 3, 5, 2, 2, 7] w TPVSDF UBSHFUͷ֤ཁૉ &MFNFOU Λ,FZͱͯ͠ɺ%JDUJPOBSZͷ4ZNCPM5BCMFʹొ࿥ w 7BMVFʹ͸ͦͷཁૉͷ TPVSDF಺Ͱͷ਺ɺUBSHFU಺Ͱͷ਺ɺTPVSDF಺ͰͷJOEFY ˞ݸ͚ͩͷ৔߹ ݸPS̎ݸҎ্ͷ৔߹͸OVMM

Slide 38

Slide 38 text

TPVSDF UBSHFU 4ZNCPM5BCMF &MFNFOU DPVOUJOTPVSDF DPVOUJOUBSHFU JOEFYJOTPVSDF OVMM OVMM source = [1, 2, 3, 4, 5, 4] target = [1, 3, 5, 2, 2, 7] w TPVSDF UBSHFUͷ֤ཁૉ &MFNFOU Λ,FZͱͯ͠ɺ%JDUJPOBSZͷ4ZNCPM5BCMFʹొ࿥ w 7BMVFʹ͸ͦͷཁૉͷ TPVSDF಺Ͱͷ਺ɺUBSHFU಺Ͱͷ਺ɺTPVSDF಺ͰͷJOEFY ɾશཁૉΛ؅ཧ͢Δ4ZNCPM5BCMFΛҰͭ༻ҙ ɾTPVSDF UBSHFUͦΕͧΕͷཁૉͷొ࿥࡞ۀΛߦ͏ ˞ݸ͚ͩͷ৔߹ ݸPS̎ݸҎ্ͷ৔߹͸OVMM

Slide 39

Slide 39 text

UBSHFU TPVSDF 4ZNCPM5BCMF &MFNFOU DPVOUJOTPVSDF DPVOUJOUBSHFU JOEFYJOTPVSDF OVMM OVMM w TPVSDF UBSHFUͷͦΕͧΕͷཁૉͱରରԠͨ͠\TPVSDF UBSHFU^3FGFSFODFTΛ༻ҙ͢Δɻ w ରରԠ͍ͯ͠Δཁૉ΁ͷࢀরΛอ࣋͠ɺࢀরݩ͸4ZNCPM5BCMFPS΋͏ยํͷ഑ྻ ˞ͲͪΒʹ΋ͦͷཁૉ͕͋Δ৔߹͸΋͏ยํͷ഑ྻ͕༏ઌ TZNCPM5BCMF TZNCPM5BCMF TZNCPM5BCMF TZNCPM5BCMF TZNCPM5BCMF TZNCPM5BCMF UBSHFU3FGFSFODFT

Slide 40

Slide 40 text

UBSHFU TPVSDF 4ZNCPM5BCMF &MFNFOU DPVOUJOTPVSDF DPVOUJOUBSHFU JOEFYJOTPVSDF OVMM OVMM w TPVSDF UBSHFUͷͦΕͧΕͷཁૉͱରରԠͨ͠\TPVSDF UBSHFU^3FGFSFODFTΛ༻ҙ͢Δɻ w ରରԠ͍ͯ͠Δཁૉ΁ͷࢀরΛอ࣋͠ɺࢀরݩ͸4ZNCPM5BCMFPS΋͏ยํͷ഑ྻ ˞ͲͪΒʹ΋ͦͷཁૉ͕͋Δ৔߹͸΋͏ยํͷ഑ྻ͕༏ઌ UIF0UIFS UIF0UIFS UIF0UIFS UIF0UIFS TZNCPM5BCMF TZNCPM5BCMF UBSHFU3FGFSFODFT

Slide 41

Slide 41 text

UIF0UIFS UIF0UIFS UIF0UIFS UIF0UIFS TZNCPM5BCMF TZNCPM5BCMF UIF0UIFS UIF0UIFS UIF0UIFS TZNCPM5BCMF UIF0UIFS TZNCPM5BCMF TPVSDF TPVSDF3FGFSFODFT UBSHFU UBSHFU3FGFSFODFT

Slide 42

Slide 42 text

w UIF0UIFSࢀরͷ৔߹.PWF w TZNCPM5BCMFࢀরͷ৔߹TPVSDFˠ%FMFUF UBSHFUˠ*OTFSU UIF0UIFS UIF0UIFS UIF0UIFS UIF0UIFS TZNCPM5BCMF TZNCPM5BCMF UIF0UIFS UIF0UIFS UIF0UIFS TZNCPM5BCMF UIF0UIFS TZNCPM5BCMF TPVSDF TPVSDF3FGFSFODFT UBSHFU UBSHFU3FGFSFODFT

Slide 43

Slide 43 text

૬खଆͷ഑ྻʹཁૉ͕͋ΔͳΒɺJOEFYΛม͑Δ.PWFͰ0, 4ZNCPM5BCMF͔͠ࢀরग़དྷͳ͍ͳΒɺ TPVSDFͳΒ%FMFUFɺUBSHFUͳΒ*OTFSU͢Δ͔͠ແ͍ UIF0UIFS UIF0UIFS UIF0UIFS UIF0UIFS TZNCPM5BCMF TZNCPM5BCMF UIF0UIFS UIF0UIFS UIF0UIFS TZNCPM5BCMF UIF0UIFS TZNCPM5BCMF ˞ແବͳ.PWF͕ൃੜ͢ΔՄೳੑ༗Γ TPVSDF TPVSDF3FGFSFODFT UBSHFU UBSHFU3FGFSFODFT w UIF0UIFSࢀরͷ৔߹.PWF w TZNCPM5BCMFࢀরͷ৔߹TPVSDFˠ%FMFUF UBSHFUˠ*OTFSU

Slide 44

Slide 44 text

)FDLFM0WFSWJFX w )BTI5BCMFΛ׆༻ͨ͠ɺཁૉͷJOEFYऔಘ w TPVSDFͱUBSHFUͷ֤ཁૉͷࢀরؔ܎ͷߏங w %FMFUF *OTFSU .PWFʹՃ͑ͯɺ6QEBUFͷऔಘ΋Մೳ w .ZFSTͱ͸จԽ͕ҟͳΓɺ4&4-$41SPCMFN͸ؔ܎ͳ͍

Slide 45

Slide 45 text

w ར༻෯ͷ޿͞ɾ$PNQMFYJUZ༏ҐੑͳͲ͕ಛ௃తͳɺ.ZFSTɾ)FDLFMͷ ͭͷݪཧΛղઆɻ͓໾ʹཱͯΕ͹ w IUUQTHJUIVCDPNIPSJUBZVZB%J⒎FSFODF"MHPSJUIN$PNQBSJTPO w 0 / ͷ$PNQMFYJUZΛ࠾༻͍ͯ͠ΔϥΠϒϥϦ΋͋Δ͕ɺ6*͕བྷΉࠩ෼ߋ৽ ϥΠϒϥϦͱͯ͋͑ͯͦ͠ΕΛબͿཧ༝͸༨Γແ͍͔΋ʁ w બఆΞϧΰϦζϜɾ࣍ݩߋ৽ɾશCBUDI6QEBUF0QFSBUJPOTରԠɾ଎౓ɾFUD 4VNNBSJ[F IUUQTHJUIVCDPNSB%J⒎FSFODF,JU

Slide 46

Slide 46 text

ɾHeckel, Paul (1978), "A Technique for Isolating Differences Between Files”, Communications of the ACM, 21: 264–268, doi:10.1145/359460.359467, retrieved 2011-12-04 ɾE. W. Myers, ‘‘An O(ND) difference algorithm and its variations,’’ Algorithmica, 1 (1986), pp. 251−266. 3FGFSFODFT