Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 30 November 2006 An Efficient Nearest Neighbor (NN) Algorithm for Peer-to-Peer (P2P) Settings Ahmed Sabbir Arif Graduate Student, York University.

Similar presentations


Presentation on theme: "1 30 November 2006 An Efficient Nearest Neighbor (NN) Algorithm for Peer-to-Peer (P2P) Settings Ahmed Sabbir Arif Graduate Student, York University."— Presentation transcript:

1 1 30 November 2006 An Efficient Nearest Neighbor (NN) Algorithm for Peer-to-Peer (P2P) Settings Ahmed Sabbir Arif Graduate Student, York University

2 2 30 November 2006 Introduction Though Peer-to-peer (P2P) networks are becoming increasingly popular as a powerful means for data exchange, methods for accessing complex data such as ‘spatial’ data on P2P networks are still at their infancy. In my presentation I will demonstrate a new and efficient algorithm for acquiring complex data off P2P Network. Organization of this presentation:  Nearest Neighbor (NN) Algorithm  P2P Network  How NN has been used in P2P data acquisition  Problem with traditional strategy  New algorithm  Comparison

3 3 30 November 2006 An Heuristic Approach to Travelling Salesman Problem (TSP) Nearest Neighbor (NN) was one of the first algorithms used to determine a solution to the Travelling Salesman Problem (TSP). It is NP-hard These are the steps of the algorithm: 1. Pick an arbitrary starting vertex. 2. Terminate if the current vertex has no unmarked edges. 3. Find the unmarked edge from the current vertex with the least weight and mark it. 4. Select the vertex at the other end of the edge. 5. Repeat from step 2. 5 4 2 1 6 3

4 4 30 November 2006 An Heuristic Approach to Travelling Salesman Problem (TSP) cont. It doesn’t in general compute the optimal result but takes little time to execute. Reliable only for special cases of the TSP where the triangle inequality is satisfied. In the worst case, the algorithm can compute tours that are by an arbitrary factor larger than the optimal tour:  For every constant r there is an instance of the TSP such that the length of the tour computed by the NN algorithm >= (r * length of the optimal tour)

5 5 30 November 2006 Peer-2-Peer Network Client Server Client Server Client Server

6 6 30 November 2006 Quadtree Data Structure A quadtree is a tree data structure in which each internal node has up to 4 children. Used to partition a 2D space by recursively subdividing it into 4 quadrants/regions. The regions may be square, rectangular or of arbitrary shapes.

7 7 30 November 2006 Distributed Hash Table (DHT) Chord A class of decentralized distributed systems that partition ownership of a set of keys among participating nodes, and can efficiently route messages to the unique owner of any given key. Can map peer address too. Chord adapts efficiently as nodes join, leave. There is a high probability that it will find a file in O(log n) time for n peers.

8 8 30 November 2006 Usual Query Strategy Chord IPKeys Quad Tree Data storage Bucket 2 Data storage Bucket 1 Data storage Bucket 3 Data storage Bucket 4 Control Point Chord routing algorithm

9 9 30 November 2006 Problems with Usual Strategies Retrieving data is not obvious because in P2P there is no central server/administration. Bad with special data. Can’t work in parallel (works sequentially). Approaches with a single root, that increases the possibility of getting an non-optimal result. Single point of failure makes all tree operation start from the peer who stores the root control point.

10 10 30 November 2006 The Minimum Level ƒ min Single point of failure makes all tree operation start from the peer who stores the root control point. To avoid this ƒ min is introduced  Forces objects to be stored (and query process to start) at a level l ƒ min ƒ max is also introduced to avoid objects being stored at l ƒ max

11 11 30 November 2006 A Practical Approach to Parallelism Have to avoid all-to-all communication. There remains a possibility where the spatial data structure will return a closer object rather than the object that is more relevant, this has to be fixed. 1 st iteration: Can be done:  By maintaining multiple entry point.  Has a single peer’s point of view. NN query ab.. priority queue Q-tree initiates

12 12 30 November 2006 Worst Case (WC) Criterion After the 1 st iteration we have:  Many blocks (and the peers who maintain them) instead of single peer.  Have chance to have more NN to be contacted. 2 nd iteration decides which ones to be contacted using WC criterion  Ensures that the relevant peers that can still help finding a closer neighbor for the next nearest neighbor are contacted  Works even for ƒ min >0

13 13 30 November 2006 Worst Case (WC) Criterion cont. Let's assume:  Quire point: q  The current nearest neighbor is at distance: m  Position is the priority queue: t  Element: e The algorithm computes the maximum distance MaxDist(q, t) Processes all elements e in the priority queue whose distance Dist(q,e) < Min(MaxDist(q, t), m) Goal is to look at two pieces of information: 1. The first spatial object in the priority queue that, in the worst case, can be the next NN. 2. The maximum possible distance from the query point to an object in the top element of the priority queue.

14 14 30 November 2006 NNQuery AAABBABB ACADBCBD CACBDADB CCCDDCDD X Y Z Control point Query point WC-1 WC-2

15 15 30 November 2006 Analysis of this New Algorithm This new NN algorithm assumes:  Every peer has perfect quadtree with height h.  There is no way to determine if the peer added before still holds the data.  P2P network matches their standard. Traditional P2P NN Algorithm  Sequential, that’s why Complexity is: O(4 h ) This new algorithm is parallel  NN will be found in: O(h) time  Increment rate would be: O(4 h/2 )  Overall complexity: O(2 h )  It’s a big improvement considering P2P network

16 16 30 November 2006 References [1] Tanin, E., Nayar, D., and Samet, H. 2005. An efficient nearest neighbor algorithm for P2P settings, Proceedings of the 2005 National Conference on Digital Government Research, Atlanta, Georgia, May 15-18, 2005, pages 21- 28. [2] G. Kedem. The Quad-CIF Tree: A data structure for hierarchical online algorithms, Proceedings of the 19th Design Automation Conference, Las Vegas, NV, June 1982, pages 352-357. [3] Wikipedia, Available: http://en.wikipedia.org/ http://en.wikipedia.org/

17 17 30 November 2006 Thank you! Questions ?


Download ppt "1 30 November 2006 An Efficient Nearest Neighbor (NN) Algorithm for Peer-to-Peer (P2P) Settings Ahmed Sabbir Arif Graduate Student, York University."

Similar presentations


Ads by Google