Finding a Length-Constrained Maximum-Density Path in a Tree Rung-Ren Lin, Wen-Hsiung Kuo, and Kun-Mao Chao.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Boosting Textual Compression in Optimal Linear Time.
Minimum Clique Partition Problem with Constrained Weight for Interval Graphs Jianping Li Department of Mathematics Yunnan University Jointed by M.X. Chen.
Algorithm Design Techniques: Greedy Algorithms. Introduction Algorithm Design Techniques –Design of algorithms –Algorithms commonly used to solve problems.
Greedy Algorithms Amihood Amir Bar-Ilan University.
Greedy Algorithms Greed is good. (Some of the time)
CS Section 600 CS Section 002 Dr. Angela Guercio Spring 2010.
Bounds on Code Length Theorem: Let l ∗ 1, l ∗ 2,..., l ∗ m be optimal codeword lengths for a source distribution p and a D-ary alphabet, and let L ∗ be.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
Heaviest Segments in a Number Sequence Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan.
Efficient Algorithms for Locating Maximum Average Consecutive Substrings Jie Zheng Department of Computer Science UC, Riverside.
296.3: Algorithms in the Real World
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
1 Huffman Codes. 2 Introduction Huffman codes are a very effective technique for compressing data; savings of 20% to 90% are typical, depending on the.
1 Pseudo-polynomial time algorithm (The concept and the terminology are important) Partition Problem: Input: Finite set A=(a 1, a 2, …, a n } and a size.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
2 -1 Analysis of algorithms Best case: easiest Worst case Average case: hardest.
1 Pseudo-polynomial time algorithm (The concept and the terminology are important) Partition Problem: Input: Finite set A=(a 1, a 2, …, a n } and a size.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
A Distributed Algorithm for Minimum-Weight Spanning Trees by R. G. Gallager, P.A. Humblet, and P. M. Spira ACM, Transactions on Programming Language and.
Data Structures – LECTURE 10 Huffman coding
Multiple Sequence alignment Chitta Baral Arizona State University.
DAST 2005 Week 4 – Some Helpful Material Randomized Quick Sort & Lower bound & General remarks…
Building Suffix Trees in O(m) time Weiner had first linear time algorithm in 1973 McCreight developed a more space efficient algorithm in 1976 Ukkonen.
CS Dept, City Univ.1 The Complexity of Connectivity in Wireless Networks Presented by LUO Hongbo.
Priority Models Sashka Davis University of California, San Diego June 1, 2003.
. Phylogenetic Trees (2) Lecture 12 Based on: Durbin et al Section 7.3, 7.8, Gusfield: Algorithms on Strings, Trees, and Sequences Section 17.
Dynamic Programming Introduction to Algorithms Dynamic Programming CSE 680 Prof. Roger Crawfis.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Dynamic Programming – Part 2 Introduction to Algorithms Dynamic Programming – Part 2 CSE 680 Prof. Roger Crawfis.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
CSCE350 Algorithms and Data Structure Lecture 17 Jianjun Hu Department of Computer Science and Engineering University of South Carolina
Dynamic Programming. Well known algorithm design techniques:. –Divide-and-conquer algorithms Another strategy for designing algorithms is dynamic programming.
Dynamic-Programming Strategies for Analyzing Biomolecular Sequences Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
 Rooted tree and binary tree  Theorem 5.19: A full binary tree with t leaves contains i=t-1 internal vertices.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
5.5.3 Rooted tree and binary tree  Definition 25: A directed graph is a directed tree if the graph is a tree in the underlying undirected graph.  Definition.
Union-find Algorithm Presented by Michael Cassarino.
Lower Bounds in Greedy Model Sashka Davis Advised by Russell Impagliazzo (Slides modified by Jeff) UC San Diego October 6, 2006.
Chapter 10 Graph Theory Eulerian Cycle and the property of graph theory 10.3 The important property of graph theory and its representation 10.4.
Efficient Algorithms for Some Variants of the Farthest String Problem Chih Huai Cheng, Ching Chiang Huang, Shu Yu Hu, Kun-Mao Chao.
Efficient heuristic algorithms for the maximum subarray problem Rung-Ren Lin and Kun-Mao Chao.
Heaviest Segments in a Number Sequence Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan.
CS 3343: Analysis of Algorithms Lecture 18: More Examples on Dynamic Programming.
Foundation of Computing Systems
Lecture 15 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Chapter 8 Maximum Flows: Additional Topics All-Pairs Minimum Value Cut Problem  Given an undirected network G, find minimum value cut for all.
1 Dynamic Programming Topic 07 Asst. Prof. Dr. Bunyarit Uyyanonvara IT Program, Image and Vision Computing Lab. School of Information and Computer Technology.
Variations of the Prize- Collecting Steiner Tree Problem Olena Chapovska and Abraham P. Punnen Networks 2006 Reporter: Cheng-Chung Li 2006/08/28.
Spanning tree Lecture 4.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
CSC5101 Advanced Algorithms Analysis
Huffman Codes. Overview  Huffman codes: compressing data (savings of 20% to 90%)  Huffman’s greedy algorithm uses a table of the frequencies of occurrence.
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 18.
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
On the R ange M aximum-Sum S egment Q uery Problem Kuan-Yu Chen and Kun-Mao Chao Department of Computer Science and Information Engineering, National Taiwan.
DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++
Hidden Markov Models Part 2: Algorithms
Comparative RNA Structural Analysis
Introduction Wireless Ad-Hoc Network
On the Range Maximum-Sum Segment Query Problem
Error Correction Coding
Presentation transcript:

Finding a Length-Constrained Maximum-Density Path in a Tree Rung-Ren Lin, Wen-Hsiung Kuo, and Kun-Mao Chao

Overview  Introduction of the problem.  A brief discussion of one-dimensional sequence.  Two approaches of finding the maximum- density path in a tree.

Input & Output  Input : A weighted tree with n edges and a lower bound L.  The lower bound is necessary.  Output : A maximum-density path with length at least L.

The Density of a Path  The density of a path is defined as follow :  Given a path with k edges E={e 1, e 2, …, e k }, and w(e) is an edge weight function. The density of such path is defined as

Lower Bound L = Max-Density = ( ) / 5 = 6

The Efficiency  We propose two efficient algorithms reach O(nL) time.  One of them is further modified to solve some special cases such as full m-ary trees in linear time.

One-Dimensional Sequence  The maximum-average segment problem arises naturally in several areas of sequence analysis.  For example, given a DNA sequence, which segment of the sequence of length at least L has the highest GC ratio.  The efficiency of the naïve algorithm of one- dimensional sequence is O(n 2 ).

Lower Bound L  There exists an optimal segment of length at most 2L-1.  It can be proved by a counter argument.  The naïve algorithm is O(nL) now. AB

The Relation between Two Overlapped Sequences  Let P[x] denotes the maximum-density of those segments that start from x.  For a given j<i ≦ P[i]<P[j], the density of (i,P[i]) is greater than the density of (j,P[j]) i P[i] jP[j] XYZ Y

Right-Skew Segment  A sequence S={s 1, s 2, …, s k } is right-skew if and only if the average of any prefix {s 1, s 2, …, s i ) is never larger than the average of the remaining subsequence {s i+1, …, s k ).  According to the tricks mentioned above, Goldwasser et al. proposed a linear time algorithm for one-dimensional sequence.

Right-skew Decomposition Decreasing right-skew decomposition is unique

Finding Maximum-Density Path In a Tree  The path in a tree is similar to the segment of an one-dimensional sequence. That is, there exists a maximum-density path of length at most 2L-1.  We propose two approaches reach the time complexity of O(nL).

Downward & Upward Paths  We classify the paths that start from node K into two types called downward and upward paths.  One is to stretch downward to its children only, called downward paths. And the other is to include at least its parent, called upward paths.

An upward path of node K K A downward path of node K A general tree

Notation  Let denotes the maximum-density downward path of node K of length i.  Let denotes the second-best one. If there is a tie, choose an arbitrary path.  Similarly, represent the maximum upward path of node K of length i.

A

Contributor  The node which determines its parent’s maximum-density downward path is called contributor.  Each maximum-density downward path of a given length has its own contributor.  The upward path has no contributor because each node has at most one parent.

A B C D node D node C node D node B

Downward & Upward Table  The downward table of node K is composed of and, where 1 ≦ i ≦ 2L-1.  Note that there exists an optimal path with length at most 2L-1  Similarly, the upward table of node K is composed of, where 1 ≦ i ≦ 2L-1.

Constructing Downward Table  For a given internal node K with m children {K 1, K 2, …, K m }. Let e j denotes the edge (K, K j ).  We can construct the downward table of node K by bottom-up dynamic programming.  All contributors should be recorded.

Constructing Upward Table  Suppose K’ is the parent of node K, and e’ denote the edge (K’, K).  Upward Table of node K can be constructed by top-down dynamic programming.

Time Complexity  Deciding a given length of downward and upward path of any node is O(1).  Thus, constructing downward and upward table of a node takes O(L).  There are totally n nodes in a tree, so it take O(nL) time to complete all downward and upward tables.

Approach I : Finding the Path from its End Node  Once the downward and upward table of each node are constructed, then we can determine the maximum-density path of a given node with length from L to 2L-1 in O(L).  Therefore, it takes O(nL) time to check all nodes since there are n nodes in such tree.

Approach II : Finding the Path from its LCA Node  LCA stands for least common ancestor.  We are now combining two downward paths together.