120 likes | 271 Views
Neighbour Joining. By Sivan Yogev. Neighbour Joining. Algorithm presented by Saitou and Nei in 1987 An approximation algorithm If the given matrix is additive, the algorithm returns the correct tree. Description. Input: A set of n objects, with a distance between every two objects
E N D
Neighbour Joining By Sivan Yogev
Neighbour Joining • Algorithm presented by Saitou and Nei in 1987 • An approximation algorithm • If the given matrix is additive, the algorithm returns the correct tree
Description • Input: A set of n objects, with a distance between every two objects • Output: unrooted tree with the given objects as leaves • We will have a graph with the original objects as nodes and add nodes to this geaph. We keep a distance matrix between each two “active” nodes
Bear Raccoon Weasel Seal Dog Initialization • Each object in a separate node, distance by input • We will use an example of 5 mammal species
Iterations • We iterate until there is only one tree • At each iteration we perform: • Find the two nodes x and y with minimal value of D(x,y). • Add a new node z, and connect x and y to this node. • Calculate the distance from x and y to z. • Compute the distance between z and the other remaining nodes, and remove x and y from the set.
Example • First iteration:
BD Bear Dog Raccoon Weasel Seal Example (cont.) • Select minimal D(i,j) • We shall select Bear and Dog
BD 6 26 Bear Dog Raccoon Weasel Seal Update • Calculate distance from new node to its “sons”
Update (cont.) • Update computation – for each t x,y we set:
BDR 1.5 19.5 BD 6 26 Bear Dog Raccoon Weasel Seal Example (cont.) • Second iteration:
BDR 1.5 19.5 BD WS 6 26 22.25 21.75 Bear Dog Raccoon Weasel Seal Example (cont.) • Third iteration:
BDR 1.5 1.5 19.5 WS BD 6 26 22.25 21.75 Bear Dog Raccoon Weasel Seal Example (cont.) • Fourth (and last) iteration: