Your SlideShare is downloading. ×
  • Like
Tree distance algorithm
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Tree distance algorithm

  • 9,843 views
Published

 

Published in Education , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
9,843
On SlideShare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
195
Comments
0
Likes
5

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Workshop on tree distance By Hector Franco francoph at tcd dot ie Trinity College of Dublin
  • 2. summary
    • Levenshtein algorithm & Sub-string matching
    • The tree edit distance
    • Basic tree concepts
    • Maps
    • Tai maps
    • Tree distance
    • Zhang Shasha algorithm & alignment
  • 3. summary
    • Levenshtein algorithm & Sub-string matching
    • The tree edit distance
    • Basic tree concepts
    • Maps
    • Tai maps
    • Tree distance
    • Zhang Shasha algorithm & alignment
  • 4. String distance metrics: Levenshtein
    • Edit-distance metrics
      • Precursor of tree distance.
      • Distance is shortest sequence of edit commands that transform s to t. (meaning the sequence of edit command that sum less cost of mapping s to t)
      • Simplest set of operations:
        • Copy/map character from s over to t, (cost 0)
        • Delete a character in s (cost 1)
        • Insert a character in t (cost 1)
        • Substitute one character for another (cost 1)
      • This is “Levenshtein distance”
  • 5. Levenshtein distance - example
    • distance(“William Cohen”, “Willliam Cohon”)
    S Domain: T Range: op cost alignment W I L L I A M _ C O H E N W I L L L I A M _ C O H O N C C C C I C C C C C C C S C 0 0 0 0 1 1 1 1 1 1 1 1 2 2
  • 6. Computing Levenshtein distance D(i,j) = score of best alignment from s1..si to t1..tj = min D(i-1,j-1) + d(si,tj) //subst/copy D(i-1,j)+1 //insert D(i,j-1)+1 //delete (simplify by letting d(c,d)=0 if c=d, 1 else) also let D(i,0)=i (for i inserts) and D(0,j)=j
  • 7. Computing Levenshtein distance - 3 D(i,j)= min D(i-1,j-1) + d(si,tj) //subst/copy D(i-1,j)+1 //insert D(i,j-1)+1 //delete The yellow row and column, correspond to the row 0 and column 0 of the table, and they are initiated in increasing order. For (int x = 0; x<size(target), x++) D(0,x) = x; For (int x = 0; x<size(source), x++) D(x,0) = x; d(si,tj) represents the cost of change the letter si into the letter tj, where if the letter is the same the cost will be 0 and if is a different letter the cost will be 1. = D( s,t ) C O H E N 0 1 2 3 4 5 M 1 1 2 3 4 5 C 2 1 2 3 4 5 C 3 2 2 3 4 5 O 4 3 2 3 4 5 H 5 4 3 2 3 4 N 6 5 4 3 3 3
  • 8. Computing Levenshtein distance - 3 D(i,j)= min D(i-1,j-1) + d(si,tj) //subst/copy D(i-1,j)+1 //insert D(i,j-1)+1 //delete C O H E N 0 1 2 3 4 5 M 1 1 2 3 4 5 C 2 1 2 3 4 5 C 3 2 2 3 4 5 O 4 3 2 3 4 5 H 5 4 3 2 3 4 N 6 5 4 3 3 3 T1 T2 Cost M - 1 C - 1 C C 0 O O 0 H H 0 - E 1 N N 0 T1 T2 Cost M - 1 C C 0 C - 1 O O 0 H H 0 - E 1 N N 0
  • 9. Practice G O O D G O D G O D TRY TRY G O O D 0 1 2 3 4 G 1 0 1 2 3 O 2 1 0 1 2 D 3 2 1 1 1
  • 10. Sub string matching
    • What is the best matching substring of S in T?
    Look for the minimum value “ niver” Cost 0 for delete positions before the sub-string u n i v e r s 0 0 0 0 0 0 0 n 1 0 1 1 1 1 1 i 2 1 0 1 2 2 2 e 3 2 1 1 1 2 3 r 4 3 2 2 2 1 2
  • 11. summary
    • Levenshtein algorithm & Sub-string matching
    • The tree edit distance
    • Basic tree concepts
    • Maps
    • Tai maps
    • Tree distance
    • Zhang Shasha algorithm & alignment
  • 12. Edit distance between trees
    • Tai 1979 introduce a criterion for matching nodes between tree representations, and Zhang and Shasha 1989 develop an algorithm that find an optimal matching tree solution for a given pair of trees.
    • For this algorithm it’s considered left to right order : what means that the order of the children of each node is important and ancestor : what means that the ancestor of each node is important.
    • For match or convert form one tree into another there are three operations allowed, as deleting a node, inserting a node and replace or changing a node.
    • When a node n is deleted, all its children are attached to the parent of n, in a insertion, it happen the opposite, it can heritage nodes as it’s own children, and a changing only affects the label of the node without any changes on the tree morphology.
  • 13. summary
    • Levenshtein algorithm & Sub-string matching
    • The tree edit distance
    • Basic tree concepts
    • Maps
    • Tai maps
    • Tree distance
    • Zhang Shasha algorithm & alignment
  • 14. Post-order traversal of trees
    • To traverse a non-empty binary tree in  postorder , perform the following operations recursively at each node:
    • 1 Traverse the left subtree.
    • 2 Traverse the right subtree.
    • 3 Visit the node .
  • 15. practice yourself 1 5 3 2 4
  • 16. Ancestors:
  • 17. Left most descendent Function l(x) give as the most left descendent of the node x
  • 18. Key roots x is a key root if:
  • 19. summary
    • Levenshtein algorithm & Sub-string matching
    • The tree edit distance
    • Basic tree concepts
    • Maps
    • Tai maps
    • Tree distance
    • Zhang Shasha algorithm & alignment
  • 20. Mappings M H S I I S S B Domain: Range:  Deleted: in the domain: Changed Exact match Inserted: in the range
  • 21. Mappings M H S I I S S B Domain: Range:  Transformation = { 1,2 } , { 2,  } , { 3,1 } , { 4,4 } , {  ,3 } Note: this is NOT a tai map. 1 1 2 2 3 3 4 4
  • 22. The sets TR: Transformations M: Map C: change Cost =1 EX: exact match Cost = 0 I: Insertion Cost = 1 D: deletion Cost= 1 TR = EX + C + I + D M = EX + C M H S I I S S B Domain: Range:  1 1 2 2 3 3 4 4
  • 23. Mappings
    • Sets:
    • C: relabeled (a,b) { 1,2 }
    • Ex: exact match (c,c) { 3,1 } , { 4,4 }
    • I: insertions (  ,b) {  ,3 }
    • D: deletions (a,  ) { 2,  }
    TR = { 1,2 } , { 2,  } , { 3,1 } , { 4,4 } , {  ,3 } M H S I I S S B Domain: Range:  1 1 2 2 3 3 4 4
  • 24. Mappings more formal
    • Let V (T) denote the set of nodes of a tree T
    • S is the Source tree
    • T is the Target tree.
    • M mapping
  • 25. summary
    • Levenshtein algorithm & Sub-string matching
    • The tree edit distance
    • Basic tree concepts
    • Maps
    • Tai maps
    • Tree distance
    • Zhang Shasha algorithm & alignment
  • 26. Tai mapping: a restricted map
    • M={(a,b), (c,d)}
    • 1 One to one node
    • 2 Sibling order preserved: brothers do not change order
    • 3 Ancestor order preserved: by change are not new ancestors
    • 1 a=c iff b=d
    • a<c iff b<d
    • Anc(a,c) iff anc (b,d).
    • Sample of tai mapping:
    • M= {(c,f),(a,e)}
    c f b d e a
  • 27. practice
    • .
    Ancestry! multiple! Possible tai mapping Sibling order 1 2 3 4 3 2 1 5 4 1 5 3 2 4
  • 28. summary
    • Levenshtein algorithm & Sub-string matching
    • The tree edit distance
    • Basic tree concepts
    • Maps
    • Tai maps
    • Tree distance
    • Zhang Shasha algorithm & alignment
  • 29. Definition : Tree distance
    • There can be multiple possible tai mappings between two trees, and at least there is one with the smallest cost.
    • “ the tree-distance is the cost of the least expensive Tai mapping”
    • Cost = |I| + |D| + |C|
  • 30. Practice: prove the “triangle inequality” Prove:  (M3)   (M1)+  (M2) | M3 = M1*M2 Clue:  (M0) = |C0|+|I0|+|D0| TR: Transformations M: Map C: change Cost =1 EX: exact match Cost = 0 I: Insertion Cost = 1 D: deletion Cost= 1 TR: Transformations M: Map C: change Cost =1 EX: exact match Cost = 0 I: Insertion Cost = 1 D: deletion Cost= 1
  • 31. Practice All possible combinations of the set m1 and m2 in m3 gives same or less cost combined, than alone. SET1 COST SET2 COST SET3 COST DIFF EX 0 EX 0 EX 0 0 EX 0 C 1 C 1 0 EX 0 D 1 D 1 0 C 1 EX 0 C 1 0 C 1 C 1 C/EX 1/0 -1/-2 C 1 D 1 D 1 -1 I 1 EX 0 I 1 0 I 1 C 1 I 1 -1 I 1 D 1 None 0 -2 D 1 None 0 D 1 0 D 1 I 1 C/EX 1/0 -1/-2 None 0 I 1 I 1 0
  • 32. summary
    • Levenshtein algorithm & Sub-string matching
    • The tree edit distance
    • Basic tree concepts
    • Maps
    • Tai maps
    • Tree distance
    • Zhang Shasha algorithm & alignment
  • 33. Zhang shasha algorithm
    •   finds the tree distance (cost of the least costly Tai mapping)
    • Important concepts:
    • Tree table -> tscore
    • Forest table -> fscore
  • 34. Forest Distance
    • Forest distance == F(), Tree distance T().
    • Cost function  = F and T
    Tree Tree Tree Forest Tree
  • 35. Tree distance  ( , )+  ( )  ( , )= min  ( , )+  ( )  ( , )+  ( ) delete add change
  • 36. Forest distance  ( , ) = min  ( , )+  ( )  ( , )+  ( ) delete add  ( , )+  ( , )
  • 37. Why this is not allowed? Clue: check tai mapping restrictions  ( , )+  ( )  ( , ) = min  ( , )+  ( )  ( , )+  ( ) delete add change
  • 38.  ( , )+  ( )  ( , )= change
  • 39. Algoritm: psedudo code
    • Preprocessing() //
      • Get most left node and key root for each node.
    • For s:=1 to |keyroots(t1)| for t:= 1 to |keyroots(t2)| i=keyroots(t1)[s]; j=keyroots(t2)[t]; Treedist(i,j); end
    • Return tdist[i,j];
  • 40. Algoritm: 2
      • Treedist(pos1,pos2) { bound1=pos1-left1[pos1]+2; bound2=pos2-left2[pos2]+2; fdist= new int[bound1,bound2]; fdist[0][0] = 0; for(i=1,i<bound1;i++) fdist[i][0]= fdist[i-1][0] + c[i][0] for(i=1,i<bound1;i++) fdist[0][i]= fdist[0][i-1] + c[0][1]
    prepare forest table
  • 41. Algoritm: 3
      • For(k=left[pos1],i=1;k<=pos1;k++,i++) For(l=left[pos1],j=1;l<=pos1;l++,j++) if((left1[k]==left1[pos1]&&(left2[l]==left2[pos2])) { // if both are trees, then tree distance
      • /// then:
      • Fdist[i][j]=MIN(
      • fdist[i-1][j]+c[0][l]
      • fdist[i][j-1]+c[ k][0]
      • fdist[i-1][j-1]+c[k][l]
      • Tdist[k][l]=fdist[i][j];
  • 42. Algoritm: 4
      • }else{ /// else:
      • M=left1[k]-left1[pos1];
      • N= left2[l]-left2[pos2];
      • Fdist[i][j]=MIN(
      • fdist[i-1][j]+c[0][l]
      • fdist[i][j-1]+c[ k][0]
      • fdist[m][n]+tdist[k][l];
      • )
      • }
  • 43. Sample
    • There is a permanent tree distance table, and a dynamic forest distance table.
    • Let’s follow the algorithm to solve this problem:
    • Color means different labels.
    6 5 2 1 3 4 6 2 4 1 3 5 t1 t2 6 6 5
  • 44. Sample
    • Position:
    • Left1 array =
    • Left2 array =
    • LR_keyroots1 =
    • LR_keyroots2 =
    t1 t2 6 5 2 1 3 4 6 2 4 1 3 5 0 1 2 3 4 5 6 Nan 1 1 3 4 1 1 Nan 1 1 3 3 5 1 Nan 0 0 1 1 0 1 Nan 0 0 0 1 1 1
  • 45. Most left
    • Position:
    • Left1 array =
    • Left2 array =
    • LR_keyroots1 =
    • LR_keyroots2 =
    t1 t2 6 5 2 1 3 4 6 2 4 1 3 5 0 1 2 3 4 5 6 Nan 1 1 3 4 1 1 Nan 1 1 3 3 5 1 Nan 0 0 1 1 0 1 Nan 0 0 0 1 1 1
  • 46. Key roots
    • Position:
    • Left1 array =
    • Left2 array =
    • LR_keyroots1 =
    • LR_keyroots2 =
    t1 t2 6 5 2 1 3 4 6 2 4 1 3 5 0 1 2 3 4 5 6 Nan 1 1 3 4 1 1 Nan 1 1 3 3 5 1 Nan 0 0 1 1 0 1 Nan 0 0 0 1 1 1
  • 47. Atomic cost: c
    • Measure of change the label node n to the node m.
    • First row and column corresponds to the cost of delete/insert a node with such label.
    6 5 2 1 3 4 6 2 4 1 3 5 t1 t2 1 2 3 4 5 6 1 2 3 4 5 6   - 1 1 1 1 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1
  • 48. Tree distance table
    • First row and column are unless , it just simplify the code.
    • The other cell are suppose to be start by 0, but we use N = Nan to illustrate that we only use the cells with value.
    • Matrix 6 *6 as the number of nodes
    • Each position x means the sub-tree T[l(x) ..x).
    t1 t2 0 1 2 3 4 5 6 01 23 456 6 5 2 1 3 4 6 2 4 1 3 5 - - - - - - - - N N N N N N - N N N N N N - N N N N N N - N N N N N N - N N N N N N - N N N N N N
  • 49. Treedist(3,4)
    • Calculations:
    • Bound1 = 3-3+2=2
    • Bound2 = 4-3+2=3
    • Fdist = new int[2][3]
    • Prepare forest distance table
    • Forest distance
    - - - - - - - - N N N N N N - N N N N N N - N N N N N N - N N N N N N - N N N N N N - N N N N N N
  • 50. Treedist(3,4) step2
    • Calculations:
    • k = 3, i = 1
    • L = 3, j = 1
    • Is a tree? -> yes
    • Set the value in Forest distance table and in tree distance table
    • L++, j++
    • Forest distance
    T( , )= min 3 3 F(  , )+  ( )=2 3 F( ,  )+  ( )=2 F(  ,  )+  ( )=0 3 3 3 3
    • It is a tree so:
    • We can look in diagonal
    • We must copy the value in tree table
    0 1 2 1 0 - - - - - - - - N N N N N N - N N N N N N - N N 0 N N N - N N N N N N - N N N N N N - N N N N N N
  • 51. Treedist(3,4) step3
    • Calculations:
    • k = 3, i = 1
    • L = 4, j = 2
    • Is a tree? -> yes
    • Set the value in Forest distance table and in tree distance table
    • L++, j++
    • Forest distance
    T( , )= min 3 F(  , )+  ( )=3 F( , )+  ( )=1 F(  , ) +  ( )=2 3 3 4 4 4 3 4 3 3 3 0 1 2 1 0 1 - - - - - - - - N N N N N N - N N N N N N - N N 0 1 N N - N N N N N N - N N N N N N - N N N N N N
  • 52. Treedist(3,5) step1
    • Calculations:
    • Bound1 = 3-3+2=2
    • Bound2 = 5-5+2=2
    • Fdist = new int[2][2]
    • Prepare forest distance table
    • Forest distance
    - - - - - - - - N N N N N N - N N N N N N - N N 0 1 N N - N N N N N N - N N N N N N - N N N N N N
  • 53. Treedist(3,5) step2
    • Calculations:
    • k = 3, i = 1
    • L = 5, j = 1
    • Is a tree? -> yes
    • Forest distance
    T( , )= min 3 5 F(  , )+  ( )=2 5 F( ,  )+  ( )=2 F(  ,  )+  ( )=0 3 3 5 5 - - - - - - - - N N N N N N - N N N N N N - N N 0 1 0 N - N N N N N N - N N N N N N - N N N N N N 0 1 1 0
  • 54. Treedist(3,6) step1
    • Calculations:
    • Bound1 = 3-3+2=2
    • Bound2 = 6-1+2=7
    • Fdist = new int[2][7]
    • Prepare forest distance table
    • Forest distance
    0 1 2 3 4 5 6 1 - - - - - - - - N N N N N N - N N N N N N - N N 0 1 0 N - N N N N N N - N N N N N N - N N N N N N
  • 55. Treedist(3,6) step2
    • Calculations:
    • k = 3, i = 1
    • L = 1, j = 1
    • Is a tree? -> yes
    • Forest distance
    T( , )= min 3 F(  , )+  ( )=2 F( ,  )+  ( )=2 F(  ,  )+  ( )=0 3 3 1 1 1 1 0 1 2 3 4 5 6 1 0 - - - - - - - - N N N N N N - N N N N N N - 0 N 0 1 0 N - N N N N N N - N N N N N N - N N N N N N
  • 56. Treedist(3,6) step3
    • Calculations:
    • k = 3, i = 1
    • L = 2, j = 2
    • Is a tree? -> yes
    • Forest distance
    T( , )= min 3 F(  , )+  ( )=2 F( , )+  ( )=1 F(  , )+  ( )=2 3 3 2 2 2 1 2 1 1 1 0 1 2 3 4 5 6 1 0 1 - - - - - - - - N N N N N N - N N N N N N - 0 1 0 1 0 N - N N N N N N - N N N N N N - N N N N N N
  • 57. Treedist(3,6) step4
    • Calculations:
    • k = 3, i = 1
    • L = 4, j = 4
    • Is a tree? -> NO
    • M = 0
    • N = 2
    • Forest distance
    T( , )= min 3 F(  , )+  ( )=4 F( , )+  ( )=2 F(  , )+T( , )=2 3 3 2 3 3
    • It is NOT a tree so:
    • We can NOT look in diagonal
    0 1 2 3 4 5 6 1 0 1 2 - - - - - - - - N N N N N N - N N N N N N - 0 1 0 1 0 N - N N N N N N - N N N N N N - N N N N N N 2 1 3 2 1 3 2 1 2 1
  • 58. Treedist(3,6) step5
    • Calculations:
    • k = 3, i = 1
    • L = 3, j = 3
    • Is a tree? -> NO
    • M = 0
    • N = 2
    • Forest distance
    T( , )= min 3 F(  , )+  ( )=5 F( , )+  ( )=3 F(  , )+T( , )=3 3 3 2 3 Size of forest 0 1 2 3 4 5 6 1 0 1 2 3 - - - - - - - - N N N N N N - N N N N N N - 0 1 0 1 0 N - N N N N N N - N N N N N N - N N N N N N 2 1 2 4 1 3 2 4 1 3 2 1 3 4 3
  • 59.  
  • 60.
    • Tree distance (3,4)-> starting in [3,3] (most left).
      • F(3..3,3..3),F(3..3,3..4)
    Key roots t1 6 5 2 1 3 4 2 4 1 3 t2
  • 61.
    • Tree distance (3,4)-> starting in [3,3] (most left).
      • F(3..3,3..3),F(3..3,3..4)
    • Tree distance (4,4)-> starting in [4,3] (most left).
      • F(4..4,3..3),F(4..4,3..4)
    Key roots t1 6 5 2 1 3 4 2 4 1 3 t2
  • 62.
    • Tree distance (3,4)-> starting in [3,3] (most left).
      • F(3..3,3..3),F(3..3,3..4)
    • Tree distance (4,4)-> starting in [4,3] (most left).
      • F(4..4,3..3),F(4..4,3..4)
    • Tree distance (6,4)-> starting in [1,3] (most left).
      • F(4..4,3..3),F(4..4,3..4)
    Key roots t1 6 5 2 1 3 4 2 4 1 3 t2
  • 63.
    • Tree distance (4,4)-> starting in [4,3] (most left).
      • F(4..4,3..3),F(3..3,3..4)
    Key roots t1 6 5 2 1 3 4 2 4 1 3 t2
  • 64.
    • Tree distance (6,4)-> starting in [1,3] (most left).
      • F(1..1,3..4), tree F(1..2,3..4), tree F(1..3,3..4), forest F(1..4,3..4), forest F(1..5,3..4), tree F(1..6,3..4), tree
    Key roots t1 We need the result of the matching for the sub-trees nodes 3 and 4, and it happen that hey are key roots! 6 5 2 1 3 4 2 4 1 3 t2 2 1 3 4  ( , ) = min  ( , )+  ( )  ( , )+  ( ) delete add  ( , )+  ( , )
  • 65. Practice:
    • Calculate the tree distance between this two trees and observe the similarity with Levenshtein algorithm. (Only 1 key root.)
    G o o d G o d Forest table = tree table = levenshtein table.
  • 66. Tree distance
    • Time:
    • Space:
  • 67. Calculate the alignment
    • Tree distance
    • Forest distance 6*6
    The algorithm can be extended in order to get the alignment: All tables are need it. This talbes corresponds to the same example as we looked before. - - - - - - - - 0 1 0 1 0 5 - 1 0 1 0 1 4 - 0 1 0 1 0 5 - 0 1 0 1 0 5 - 4 3 4 3 4 2 - 5 4 5 4 5 3 0 1 2 3 4 5 6 1 0 1 2 3 4 5 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 2 1 2 5 4 3 2 3 2 2 6 5 4 3 4 3 3
  • 68. Calculate the alignment
    • Tree distance
    • Forest distance 6*6
    (6,6) - - - - - - - - 0 1 0 1 0 5 - 1 0 1 0 1 4 - 0 1 0 1 0 5 - 0 1 0 1 0 5 - 4 3 4 3 4 2 - 5 4 5 4 5 3 0 1 2 3 4 5 6 1 0 1 2 3 4 5 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 2 1 2 5 4 3 2 3 2 2 6 5 4 3 4 3 3
  • 69. Calculate the alignment
    • Tree distance
    • Forest distance 6*6
    (6,6), - - - - - - - - 0 1 0 1 0 5 - 1 0 1 0 1 4 - 0 1 0 1 0 5 - 0 1 0 1 0 5 - 4 3 4 3 4 2 - 5 4 5 4 5 3 0 1 2 3 4 5 6 1 0 1 2 3 4 5 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 2 1 2 5 4 3 2 3 2 2 6 5 4 3 4 3 3
  • 70. Calculate the alignment
    • Tree distance
    • Forest distance 6*6
    (6,6), (4,5) - - - - - - - - 0 1 0 1 0 5 - 1 0 1 0 1 4 - 0 1 0 1 0 5 - 0 1 0 1 0 5 - 4 3 4 3 4 2 - 5 4 5 4 5 3 0 1 2 3 4 5 6 1 0 1 2 3 4 5 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 2 1 2 5 4 3 2 3 2 2 6 5 4 3 4 3 3
  • 71. Calculate the alignment
    • Tree distance
    • Forest distance 6*6
    (6,6), (4,5) - - - - - - - - 0 1 0 1 0 5 - 1 0 1 0 1 4 - 0 1 0 1 0 5 - 0 1 0 1 0 5 - 4 3 4 3 4 2 - 5 4 5 4 5 3 0 1 2 3 4 5 6 1 0 1 2 3 4 5 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 2 1 2 5 4 3 2 3 2 2 6 5 4 3 4 3 3
  • 72. Calculate the alignment
    • Tree distance
    • Forest distance 6*6
    (6,6), (4,5), (2,2) - - - - - - - - 0 1 0 1 0 5 - 1 0 1 0 1 4 - 0 1 0 1 0 5 - 0 1 0 1 0 5 - 4 3 4 3 4 2 - 5 4 5 4 5 3 0 1 2 3 4 5 6 1 0 1 2 3 4 5 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 2 1 2 5 4 3 2 3 2 2 6 5 4 3 4 3 3
  • 73. Calculate the alignment
    • Tree distance
    • Forest distance 6*6
    (6,6), (4,5), (2,2), (1,1). - - - - - - - - 0 1 0 1 0 5 - 1 0 1 0 1 4 - 0 1 0 1 0 5 - 0 1 0 1 0 5 - 4 3 4 3 4 2 - 5 4 5 4 5 3 0 1 2 3 4 5 6 1 0 1 2 3 4 5 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 2 1 2 5 4 3 2 3 2 2 6 5 4 3 4 3 3
  • 74. THANKS FOR YOUR ATENTION