Segment Tree and Its Usage for geometric Computations

Slides:



Advertisements
Similar presentations
INTERVAL TREE & SEGMENTATION TREE
Advertisements

Greedy Algorithms Amihood Amir Bar-Ilan University.
Visibility Graphs May Shmuel Wimer Bar-Ilan Univ., Eng. Faculty Technion, EE Faculty.
May Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
CS 171: Introduction to Computer Science II
Efficient Algorithmic Techniques for Several Multidimensional Geometric Data Management and Analysis Problems Mugurel Ionut Andreica Politehnica University.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
BTrees & Bitmap Indexes
Multiple-key indexes Index on one attribute provides pointer to an index on the other. If V is a value of the first attribute, then the index we reach.
Binary Trees Terminology A graph G = is a collection of nodes and edges. An edge (v 1,v 2 ) is a pair of vertices that are directly connected. A path,
Special Cases of the Hidden Line Elimination Problem Computational Geometry, WS 2007/08 Lecture 16 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Hidden-Line Elimination Computational Geometry, WS 2006/07 Lecture 14 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
The Euler-tour technique
Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment.
Chapter 9: Graphs Spanning Trees Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Important Problem Types and Fundamental Data Structures
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
May Motion Planning Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
March Trapezoidal Maps Shmuel Wimer Bar Ilan Univ., School of Engineering.
VLSI Backend CAD Konstantin Moiseev – Intel Corp. & Technion Shmuel Wimer – Bar Ilan Univ. & Technion.
“On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra.
Trees By Charl du Plessis. Contents Basic Terminology Basic Terminology Binary Search Trees Binary Search Trees Interval Trees Interval Trees Binary Indexed.
1 Trees 2 Binary trees Section Binary Trees Definition: A binary tree is a rooted tree in which no vertex has more than two children –Left and.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Lars Arge Presented by Or Ozery. I/O Model Previously defined: N = # of elements in input M = # of elements that fit into memory B = # of elements per.
Computer Science: A Structured Programming Approach Using C Graphs A graph is a collection of nodes, called vertices, and a collection of segments,
Segment Trees Basic data structure in computational geometry. Computational geometry.  Computations with geometric objects.  Points in 1-, 2-, 3-, d-space.
A Static Data Structure for Discrete Advance Bandwidth Reservations on the Internet Andrej Brodnik Andreas Nilsson CSEE Luleå University of Technology.
SEGMENT TREES. Originally introduced by Bentley(1977) Handle intervals on the real line whose end-points belong to a fixed set of N abscissae. A static.
Trees 2: Section 4.2 and 4.3 Binary trees. Binary Trees Definition: A binary tree is a rooted tree in which no vertex has more than two children
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
1 Schnyder’s Method. 2 Motivation Given a planar graph, we want to embed it in a grid We want the grid to be relatively small And we want an efficient.
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
DS.T.1 Trees Chapter 4 Overview Tree Concepts Traversals Binary Trees Binary Search Trees AVL Trees Splay Trees B-Trees.
Line Sweep Algorithms Schalk-Willem Krüger – 2009 Training Camp 1 presentation.start();
May 2012Range Search Algorithms1 Shmuel Wimer Bar Ilan Univ. Eng. Faculty Technion, EE Faculty.
Geometric Transformations for Computer Graphics
Geometric Transformations for Computer Graphics
Geometric Data Structures
Data Structures: Disjoint Sets, Segment Trees, Fenwick Trees
CPS216: Data-intensive Computing Systems
Top 50 Data Structures Interview Questions
The Design and Analysis of Algorithms
Source Code for Data Structures and Algorithm Analysis in C (Second Edition) – by Weiss
Chapter 6 Transform-and-Conquer
Tree.
Mean Shift Segmentation
Binary Tree Applications
Data Compression If you’ve ever sent a large file to a friend, you may have compressed it into a zip archive like the one on this slide before doing so.
Notes Over 4.2 Is a Solution Verifying Solutions of an Equation
Orthogonal Range Searching and Kd-Trees
CS222P: Principles of Data Management Notes #6 Index Overview and ISAM Tree Index Instructor: Chen Li.
Chapter 6 Transform and Conquer.
Segment Trees Basic data structure in computational geometry.
Graphs Chapter 11 Objectives Upon completion you will be able to:
Shmuel Wimer Bar Ilan Univ., School of Engineering
Binary Trees: Motivation
Algorithm design (computational geometry)
Binary Trees, Binary Search Trees
CS222/CS122C: Principles of Data Management Notes #6 Index Overview and ISAM Tree Index Instructor: Chen Li.
Dynamic rectangular intersection with priorities
Boolean Algebra for CAD Applications
Binary Trees, Binary Search Trees
CS222/CS122C: Principles of Data Management UCI, Fall 2018 Notes #05 Index Overview and ISAM Tree Index Instructor: Chen Li.
Dynamic rectangular intersection with priorities
Chapter 9: Graphs Spanning Trees
Presentation transcript:

Segment Tree and Its Usage for geometric Computations Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty April 2012 Segment Tree

Motivation We may be interested in calculating the underling area, perimeter or contour construction April 2012 Segment Tree

Segment Tree Definition Introduced by J. L. Bentley in 1977 Data structure designed to handle intervals on the real line Intervals end points belong to a fixed set of abscissas Abscissas can be normalized to range [1,N] without loss of generality by using a lookup table Given an interval [l,r], the segment tree T(l,r) is a rooted binary tree defined recursively April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

4,15 9,15 4,9 6,9 4,6 12,15 9,12 5,6 4,5 7,9 6,7 10,12 9,10 13,15 12,13 8,9 7,8 11,12 10,11 14,15 13,14 April 2012 Segment Tree

Insertion and Deletion April 2012 Segment Tree

Insertion and Deletion April 2012 Segment Tree

April 2012 Segment Tree

1,257 1,129 65,129 97,129 65,97 65,81 81,97 97,115 105,109 97,105 105,115 105,107 73,81 73,77 73,75 74,75 75,77 77,81 April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

Allocation and De-Allocation Depends on application. If we wish to know the cardinality of cover of [B[v],E[v]] then a counter C[v] is associated with node v: C[v] = C[V]+1 is allocation for INSERT C[v] = C[V]-1 is de-allocation for DELETE In many cases C[v] indicates the presence of material, so we’ll be interested in whether C[v] > 0 (material exists) or C[v]==0 (no material). April 2012 Segment Tree

1D Measure of Union of Intervals April 2012 Segment Tree

1D Measure of Union of Intervals April 2012 Segment Tree

April 2012 Segment Tree

2D Measure (Area) of Union of Rectangles April 2012 Segment Tree

2D Measure (Area) of Union of Rectangles April 2012 Segment Tree

scan-line April 2012 Segment Tree

Efficient Calculation of m(xi) April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

Perimeter of Union of Rectangles Perimeter is the length sum of: vertical edges horizontal edges April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

The Contour of Union of Rectangles April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

Completing the Cycles of Contour April 2012 Segment Tree

April 2012 Segment Tree

e1 e3 e2 e6 e5 e8 e7 e4 e9 e10 April 2012 Segment Tree

There’s no ambiguity in deciding whether to go to left or right triplet when an horizontal edge is decided. It follows that a pair of successive triplets defines horizontal edges. Consequently, once two successive triplets are traversed and define a new horizontal edge, the number of triplets on both the left and the right parts of the list must be even. Therefore, if the index of a triplet is even, its left adjacent triplet is paired, otherwise, the right triplet is paired. April 2012 Segment Tree

Run-time Complexity April 2012 Segment Tree

April 2012 Segment Tree

U’ U” |P(U’)+ P(U”)|=7 U’ U” |P(U’)+ P(U”)|=5 April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree

April 2012 Segment Tree