refactoring LowestCommonAncestor. more readable.
refactoring MutableUndirectedWeightedGraph. use common class