Editing Tree

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 72: Line 72:
 
* '''[[Lowest common ancestor]] (LCA) problem''': Given a pair of nodes in a tree, efficiently determine their lowest common ancestor, that is, the deepest node that is an ancestor of both given nodes. A variety of algorithms exist for this important problem.
 
* '''[[Lowest common ancestor]] (LCA) problem''': Given a pair of nodes in a tree, efficiently determine their lowest common ancestor, that is, the deepest node that is an ancestor of both given nodes. A variety of algorithms exist for this important problem.
 
* It is easy to find the ''distance'' between any pair of nodes in a tree, weighted or unweighted, because there is only one path to consider, which may be found using depth-first search or breadth-first search.
 
* It is easy to find the ''distance'' between any pair of nodes in a tree, weighted or unweighted, because there is only one path to consider, which may be found using depth-first search or breadth-first search.
:* To find the ''diameter'' of a tree, pick any starting vertex <math>u</math>, find the vertex <math>v</math> furthest away from <math>u</math> using DFS or BFS (breaking ties arbitrarily), and then find the vertex <math>w</math> furthest away from <math>v</math>. The distance between <math>v</math> and <math>w</math> is the tree's diameter.<ref name="diameter">Bang Ye Wu and Kun&ndash;Mao Chao. ''A note on Eccentricities, diameters, and radii''. Retrieved from http://www.csie.ntu.edu.tw/~kmchao/tree07spr/diameter.pdf</ref>
+
:* To find the ''diameter'' of a tree, pick any starting vertex <math>u</math>, find the vertex <math>v</math> furthest away from <math>u</math> using DFS or BFS (breaking ties arbitrarily), and then find the vertex <math>w</math> furthest away from <math>v</math>. The distance between <math>v</math> and <math>w</math> is the tree's diameter. ([[Tree/Diameter proof|proof]])
 
:* In the ''dynamic distance query'' problem, we wish to be able to efficiently determine the distances between pairs of nodes in a tree, but we also want to be able to change the weights of edges. This problem is solved using the [[heavy-light decomposition]].
 
:* In the ''dynamic distance query'' problem, we wish to be able to efficiently determine the distances between pairs of nodes in a tree, but we also want to be able to change the weights of edges. This problem is solved using the [[heavy-light decomposition]].
 
* The ''maximum matching problem'', ''minimum vertex cover problem'', ''minimum edge cover problem'', and ''maximum independent set problem'' all admit simple [[dynamic programming]] solutions when the graph involved is a tree.
 
* The ''maximum matching problem'', ''minimum vertex cover problem'', ''minimum edge cover problem'', and ''maximum independent set problem'' all admit simple [[dynamic programming]] solutions when the graph involved is a tree.
 
==References==
 
<references/>
 
  
 
[[Category:Graph theory]]
 
[[Category:Graph theory]]
 
[[Category:Pages needing diagrams]]
 
[[Category:Pages needing diagrams]]
 
[[Category:Trees]]
 
[[Category:Trees]]

Please note that all contributions to PEGWiki are considered to be released under the Attribution 3.0 Unported (see PEGWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Retrieved from "https://wcipeg.com/wiki/Tree"