On Efficient Spatial Matching Raymond Chi-Wing Wong (the Chinese University of Hong Kong) Yufei Tao (the Chinese University of Hong Kong) Ada Wai-Chee.

Slides:



Advertisements
Similar presentations
Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science.
Advertisements

Ranking Outliers Using Symmetric Neighborhood Relationship Wen Jin, Anthony K.H. Tung, Jiawei Han, and Wei Wang Advances in Knowledge Discovery and Data.
Aggregating local image descriptors into compact codes
1 A FAIR ASSIGNMENT FOR MULTIPLE PREFERENCE QUERIES Leong Hou U, Nikos Mamoulis, Kyriakos Mouratidis Gruppo 10: Paolo Barboni, Tommaso Campanella, Simone.
Nearest Neighbor Queries using R-trees
1 Finding Shortest Paths on Terrains by Killing Two Birds with One Stone Manohar Kaul (Aarhus University) Raymond Chi-Wing Wong (Hong Kong University of.
School of Computer Science and Engineering Finding Top k Most Influential Spatial Facilities over Uncertain Objects Liming Zhan Ying Zhang Wenjie Zhang.
Improved Efficiency for Private Stable Matching Matthew Franklin, Mark Gondree, and Payman Mohassel University of California, Davis 02/07/07 - Session.
Specialised N-ary Constraint for the Stable Marriage Problem By Chris Unsworth and Patrick Prosser.
1 Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
Reverse Furthest Neighbors in Spatial Databases Bin Yao, Feifei Li, Piyush Kumar Florida State University, USA.
July 29HDMS'08 Caching Dynamic Skyline Queries D. Sacharidis 1, P. Bouros 1, T. Sellis 1,2 1 National Technical University of Athens 2 Institute for Management.
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
the fourth iteration of this loop is shown here
Quantile-Based KNN over Multi- Valued Objects Wenjie Zhang Xuemin Lin, Muhammad Aamir Cheema, Ying Zhang, Wei Wang The University of New South Wales, Australia.
Spatio-temporal Databases Time Parameterized Queries.
1 Refining the Basic Constraint Propagation Algorithm Christian Bessière and Jean-Charles Régin Presented by Sricharan Modali.
Chapter 4: Divide and Conquer The Design and Analysis of Algorithms.
1 Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor Raymond Chi-Wing Wong (Hong Kong University of Science and Technology) M. Tamer.
Efficient Skyline Querying with Variable User Preferences on Nominal Attributes Raymond Chi-Wing Wong 1, Ada Wai-Chee Fu 2, Jian Pei 3, Yip Sing Ho 2,
Euripides G.M. PetrakisIR'2001 Oulu, Sept Indexing Images with Multiple Regions Euripides G.M. Petrakis Dept.
Indexing Spatio-Temporal Data Warehouses Dimitris Papadias, Yufei Tao, Panos Kalnis, Jun Zhang Department of Computer Science Hong Kong University of Science.
Quantum Algorithms II Andrew C. Yao Tsinghua University & Chinese U. of Hong Kong.
Spatial and Temporal Databases Efficiently Time Series Matching by Wavelets (ICDE 98) Kin-pong Chan and Ada Wai-chee Fu.
1 Efficient Algorithms for Optimal Location Queries in Road Networks Zitong Chen (Sun Yat-Sen University) Yubao Liu (Sun Yat-Sen University) Raymond Chi-Wing.
1 Hypersphere Dominance: An Optimal Approach Cheng Long, Raymond Chi-Wing Wong, Bin Zhang, Min Xie The Hong Kong University of Science and Technology Prepared.
The Stable Marriage Problem
The University of Hong Kong 1 Capacity Constrained Assignment in Spatial Databases Authors: Leong Hou U, University of Hong Kong Man Lung Yiu, Aalborg.
VLDB '2006 Haibo Hu (Hong Kong Baptist University, Hong Kong) Dik Lun Lee (Hong Kong University of Science and Technology, Hong Kong) Victor.
Pelvic floor Specialised Constraints for Stable Matching Problems Contact details: 17 Lilybank Gardens Glasgow G12 8QQ The Problem.
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
1 Exact Top-k Nearest Keyword Search in Large Networks Minhao Jiang†, Ada Wai-Chee Fu‡, Raymond Chi-Wing Wong† † The Hong Kong University of Science and.
Towards Robust Indexing for Ranked Queries Dong Xin, Chen Chen, Jiawei Han Department of Computer Science University of Illinois at Urbana-Champaign VLDB.
Influence Zone: Efficiently Processing Reverse k Nearest Neighbors Queries Presented By: Muhammad Aamir Cheema Joint work with Xuemin Lin, Wenjie Zhang,
1 The Stable Marriage Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
CSED101 INTRODUCTION TO COMPUTING TREE 2 Hwanjo Yu.
All Pair Shortest Path IOI/ACM ICPC Training June 2004.
Nearest Neighbor Queries Chris Buzzerd, Dave Boerner, and Kevin Stewart.
1 11 Channel Assignment for Maximum Throughput in Multi-Channel Access Point Networks Xiang Luo, Raj Iyengar and Koushik Kar Rensselaer Polytechnic Institute.
On Computing Top-t Influential Spatial Sites Authors: T. Xia, D. Zhang, E. Kanoulas, Y.Du Northeastern University, USA Appeared in: VLDB 2005 Presenter:
9/2/2005VLDB 2005, Trondheim, Norway1 On Computing Top-t Most Influential Spatial Sites Tian Xia, Donghui Zhang, Evangelos Kanoulas, Yang Du Northeastern.
Chapter 5 Algorithms (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
1 On Optimal Worst-Case Matching Cheng Long (Hong Kong University of Science and Technology) Raymond Chi-Wing Wong (Hong Kong University of Science and.
Bipartite Matching. Unweighted Bipartite Matching.
Euripides G.M. PetrakisIR'2001 Oulu, Sept Indexing Images with Multiple Regions Euripides G.M. Petrakis Dept. of Electronic.
Sorting and Searching by Dr P.Padmanabham Professor (CSE)&Director
Bin Yao, Feifei Li, Piyush Kumar Presenter: Lian Liu.
The Stable Marriage Problem
Network Flows Chun-Ta, Yu Graduate Institute Information Management Dept. National Taiwan University.
Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:
1 Finding Competitive Price Yu Peng (Hong Kong University of Science and Technology) Raymond Chi-Wing Wong (Hong Kong University of Science and Technology)
LIMITATIONS OF ALGORITHM POWER
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 23 Algorithm Efficiency.
Fair Shares.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
Efficient OLAP Operations in Spatial Data Warehouses Dimitris Papadias, Panos Kalnis, Jun Zhang and Yufei Tao Department of Computer Science Hong Kong.
CSCI 256 Data Structures and Algorithm Analysis Lecture 2 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Market Design and Analysis Lecture 2 Lecturer: Ning Chen ( 陈宁 )
CS Machine Learning Instance Based Learning (Adapted from various sources)
1 Reverse Nearest Neighbor Queries for Dynamic Databases SHOU Yu Tao Jan. 10 th, 2003 SIGMOD 2000.
Dept. of Computer Science Assignment Problems in Spatial Databases Kamiru Leong Hou, U Supervisor: Nikos Mamoulis Probation Talk:
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Matchings and Factors Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
Da Yan, Raymond Chi-Wing Wong, and Wilfred Ng The Hong Kong University of Science and Technology.
Cluster Analysis II 10/03/2012.
Stable Matching.
Influence sets based on Reverse Nearest Neighbor Queries
CSE 421: Introduction to Algorithms
Lecture 6 CSE 331 Sep 11, 2017.
Lecture 6 CSE 331 Sep 12, 2016.
Lecture 7 CSE 331 Sep 11, 2013.
Presentation transcript:

On Efficient Spatial Matching Raymond Chi-Wing Wong (the Chinese University of Hong Kong) Yufei Tao (the Chinese University of Hong Kong) Ada Wai-Chee Fu (the Chinese University of Hong Kong) Xiaokui Xiao (the Chinese University of Hong Kong) Presented by Raymond Chi-Wing Wong

Outline 1.Introduction Related work – Bichromatic Reverse Nearest Neighbor 2.Problem Spatial Matching Problem (SPM) Unweighted SPM Weighted SPM 3.Algorithm Chain (for unweighed SPM) Weighted Chain (for weighted SPM) 4.Empirical Study 5.Conclusion

1. Introduction Bichromatic Reverse Nearest Neighbor (BRNN) Given P and O are two sets of objects in the same data space Problem Given an object p  P, a BRNN query finds all the objects o  O whose nearest neighbor (NN) in P are p.

1. Introduction NN in P = p 1 NN: Nearest neighbor RNN: Reverse nearest neighbor p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 NN in P = p 1 RNN = {o 1, o 2, o 3 } RNN = {} P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates

1. Introduction NN: Nearest neighbor RNN: Reverse nearest neighbor p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 RNN = {o 1, o 2, o 3 } P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates However, this assignment is not suitable because each polling place has a “ serving capacity ”.

1. Introduction NN: Nearest neighbor RNN: Reverse nearest neighbor p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 RNN = {o 1, o 2, o 3 } P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates 7k3k 4k 10k The total population from o 1, o 2 and o 3 is equal to 14k, which is greater than the capacity of p 1 Thus, bichromatic RNN cannot handle this assignment problem. Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Idea: SPM aims at allocating each estate o  O to the polling-place p  P that (i) is as near to o as possible, and (ii) its servicing capacity has not been exhausted in serving other closer estates.

2. Problem 1.Unweighted SPM Capacity of p i  P (denoted by p i.w) = 1 Population of o j  O (denoted by o j.w) = 1 2.Weighted SPM Capacity of p i  P (denoted by p i.w)  1 Population of o j  O (denoted by o j.w)  1

2. Problem Theorem: The problem of computing the BRNN set of each object p  P is an instance of weighted SPM, where p.w = |O| for every p  P and o.w=1 for every o  O. Weighted SPM BRNN

2. Problem Related Work Closest Pair Running time = O(|P| x |O| 2 ) Stable Marriage A classical problem in Computer Science Running time = O(|P| x |O|) Our Proposed Algorithm Chain Running time = O( |O| x log O(1) |P| ) Significant improvement on running time

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Unweighted SPM How can we perform an assignment between P and O?

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Unweighted SPM How can we perform an assignment between P and O? First, we consider an assignment A.

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Unweighted SPM How can we perform an assignment between P and O? (p 2, o 3 ) is a dangling pair. |p 2, o 3 | < |p 2, o 2 | First, we consider an assignment A. (p, o) is a dangling pair if 1. |p, o| < the distance between o and its partner in A 2. |p, o| < the distance between p and its partner in A

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Unweighted SPM How can we perform an assignment between P and O? (p 2, o 3 ) is a dangling pair. |p 2, o 3 | < |p 2, o 2 | |p 2, o 3 | < |p 3, o 3 | First, we consider an assignment A. (p, o) is a dangling pair if 1. |p, o| < the distance between o and its partner in A 2. |p, o| < the distance between p and its partner in A If the assignment A does NOT contain any dangling pair, then the assignment is fair. This assignment is NOT fair because we find a dangling pair.

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Unweighted SPM (p, o) is a dangling pair if 1. |p, o| < the distance between o and its partner in A 2. |p, o| < the distance between p and its partner in A If the assignment A does NOT contain any dangling pair, then the assignment is fair. This assignment is fair because we cannot find a dangling pair.

2. Problem Unweighted SPM Dangling pair Weighted SPM Dangling pair

3. Algorithm Un-weighted SPM problem Algorithm (Un-weighted) Chain Weighted SPM problem Algorithm Weighted Chain

3.1 Algorithm Algorithm Chain makes use of bichromatic mutual NN to find the fair assignment. An object p  P and an object o  O are bichromatic mutual NN if p is the NN of o in P and o is the NN of p in O

3.1 Algorithm p3p3 p2p2 p1p1 p4p4 o1o1 o2o2 o3o3 o4o4 Unweighted SPM

3.1 Algorithm p3p3 p2p2 p1p1 p4p4 o1o1 o2o2 o3o3 o4o4 (p 3, o 3 ) is a pair of mutual NN. (p 3, o 3 ) corresponds to a match. We can remove it. Assignment = { } (p 3, o 3 ) Unweighted SPM

3.1 Algorithm p2p2 p1p1 p4p4 o1o1 o2o2 o4o4 (p 2, o 2 ) is a pair of mutual NN. (p 2, o 2 ) corresponds to a match. We can remove it. Assignment = { } (p 3, o 3 ), (p 2, o 2 ) Unweighted SPM

3.1 Algorithm p1p1 p4p4 o1o1 o4o4 (p 4, o 4 ) is a pair of mutual NN. (p 4, o 4 ) corresponds to a match. We can remove it. Assignment = { } (p 3, o 3 ), (p 2, o 2 ) (p 4, o 4 ), Unweighted SPM

3.1 Algorithm p1p1 o1o1 (p 1, o 1 ) is a pair of mutual NN. (p 1, o 1 ) corresponds to a match. We can remove it. Assignment = { } (p 3, o 3 ), (p 2, o 2 ) (p 4, o 4 ),, (p 1, o 1 ) Unweighted SPM

3.1 Algorithm p1p1 o1o1 Assignment = { } (p 3, o 3 ), (p 2, o 2 ) (p 4, o 4 ),, (p 1, o 1 ) p4p4 o4o4 p2p2 o2o2 p3p3 o3o3 We prove that this assignment is fair. We can find a fair assignment by repeatedly removing pairs of mutual NN. But, how can we find a pair of mutual NN efficiently? We propose Algorithm Chain to perform mutual NN search efficiently. Unweighted SPM

3.1 Algorithm Find the first mutual NN (nearest neighbor) and remove it Find the second mutual NN and remove it … Find the n-th mutual NN and remove it

3.1 Algorithm Chain p1p1 o1o1 p4p4 o4o4 p2p2 o2o2 p3p3 o3o3 From o 1, find NN in P (i.e., p 1 ) Unweighted SPM Randomly find a data point o

3.1 Algorithm Chain p1p1 o1o1 p4p4 o4o4 p2p2 o2o2 p3p3 o3o3 From p 1, find NN in O (i.e., o 2 ) Since o 2 is NOT equal to o 1, (p 1, o 1 ) is not a pair of mutual NN. We need to continue the process. Unweighted SPM

3.1 Algorithm Chain p1p1 o1o1 p4p4 o4o4 p2p2 o2o2 p3p3 o3o3 From o 2, find NN in P (i.e., p 2 ) Since p 2 is NOT equal to p 1, (p 1, o 2 ) is not a pair of mutual NN. We need to continue the process. Unweighted SPM Note that we are expanding a chain from data point o 1.

3.1 Algorithm Chain p1p1 o1o1 p4p4 o4o4 p2p2 o2o2 p3p3 o3o3 From p 2, find NN in O (i.e., o 2 ) Now, we find a pair of mutual NN (p 2, o 2 ). We can remove it. Assignment = { } (p 2, o 2 ) Unweighted SPM

3.1 Algorithm Chain p1p1 o1o1 p4p4 o4o4 p3p3 o3o3 Assignment = { } (p 2, o 2 ) Unweighted SPM We find the FIRST mutual NN. Should we perform similar steps to find the SECOND mutual NN? That is, should we randomly select a data point again and re-start the chain? Yes. We can do in this way. But, it is NOT efficient. Instead, we can re-use the existing chain to find the SECOND mutual NN.

3.1 Algorithm Chain p1p1 o1o1 p4p4 o4o4 p3p3 o3o3 From p 1, find NN in O (i.e., o 4 ) Since o 4 is NOT equal to o 1, (p 1, o 1 ) is not a pair of mutual NN. We need to continue the process. Assignment = { } (p 2, o 2 ) Unweighted SPM

3.1 Algorithm Chain p1p1 o1o1 p4p4 o4o4 p3p3 o3o3 From o 4, find NN in P (i.e., p 4 ) Since p 4 is NOT equal to p 1, (p 1, o 4 ) is not a pair of mutual NN. We need to continue the process. Assignment = { } (p 2, o 2 ) Unweighted SPM

3.1 Algorithm Chain p1p1 o1o1 p4p4 o4o4 p3p3 o3o3 From p 4, find NN in O (i.e., o 4 ) Now, we find a pair of mutual NN (p 4, o 4 ). We can remove it. Assignment = { } (p 2, o 2 ), (p 4, o 4 ) Unweighted SPM

3.1 Algorithm Chain p1p1 o1o1 p3p3 o3o3 From p 1, find NN in O (i.e., o 1 ) Now, we find a pair of mutual NN (p 1, o 1 ). We can remove it. Assignment = { } (p 2, o 2 ), (p 4, o 4 ) (p 1, o 1 ), Unweighted SPM

3.1 Algorithm Chain p3p3 o3o3 From o 3, find NN in P (i.e., p 3 ) Assignment = { } (p 2, o 2 ), (p 4, o 4 ) (p 1, o 1 ), Unweighted SPM Randomly find a data point o

3.1 Algorithm Chain p3p3 o3o3 From p 3, find NN in O (i.e., o 3 ) Now, we find a pair of mutual NN (p 3, o 3 ). We can remove it. Assignment = { } (p 2, o 2 ), (p 4, o 4 ) (p 1, o 1 ),, (p 3, o 3 ) Unweighted SPM

3.1 Algorithm Chain Theorem: (Un-weighted) Chain performs at most 3|O| NN queries and exactly 2|O| object deletions. Theorem: The running time of (Un-weighted) Chain is O( |O| x (  (|P|)+  (|P|) ) )  (n): worst case complexity of an NN query on dataset of size n  (n): worst case complexity of an object deletion on dataset of size n  (n) and  (n) can be accomplished in O(log O(1) (n)). Thus, the running time is O( |O| x log O(1) |P| ) Unweighted SPM T.M. Chan, A Dynamic Data Structure for 3-d Convex Hulls and 2-d Nearest Neighbor Queries, SODA 2006

3.2 Algorithm Weighted Chain Similar to (Unweighted) Chain Consider the population and the capacity of each point

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o2o2 o3o Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o2o2 o3o From o 1, find NN in P (i.e., p 1 ) Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o2o2 o3o From p 1, find NN in O (i.e., o 2 ) Since o 2 is NOT equal to o 1, (p 1, o 1 ) is not a pair of mutual NN. We need to continue the process. Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o2o2 o3o From o 2, find NN in P (i.e., p 1 ) Now, we find a pair of mutual NN (p 1, o 2 ). We can remove (p 1, o 2, 10). Assignment = { } (p 1, o 2, 10) Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o3o From p 1, find NN in O (i.e., o 3 ) Assignment = { } (p 1, o 2, 10) Since o 3 is NOT equal to o 1, (p 1, o 1 ) is not a pair of mutual NN. We need to continue the process. Weighted SPM Similar steps are performed.

3.2 Algorithm Weighted Chain Theorem: Weighted Chain performs at most 3(|P| + |O|) NN queries and at most |P| + |O| object deletions Theorem: The running time of Weighted Chain is O( (|P| + |O|) x (  (|P|)+  (|P|)+  (|O|)+  (|O|)) )  (n): worst case complexity of an NN query on dataset of size n  (n): worst case complexity of an object deletion on dataset of size n  (n) and  (n) can be accomplished in O(log O(1) (n)). Thus, the running time is O( (|P| + |O|) x (log O(1) |P| + log O(1) |O|) ) Weighted SPM

4. Empirical Study Synthetic Dataset P: Gaussian distribution O: Zipfian distribution Real Dataset Rtree Portal CA (62,556) LB (53,145) GR (23,268) GM (36,334) P: one of the above datasets O: one of the above datasets

4. Empirical Study NN query in Chain Build R*-tree on P Build R*-tree on O

4. Empirical Study Measurements Execution Time Memory Usage Total no. of NN queries/|O| Total no. of NN queries/(|P| + |O|) Comparison with adapted algorithms Gale-Shapley Closest Pair

4. Empirical Study Un-weighted SPM

4. Empirical Study Weighted SPM

4. Empirical Study Real Data Set

5. Conclusion Un-weighted and Weighted Spatial Matching Problem A general model of BRNN Algorithm Chain Theoretical Analysis of Running Time Significant Improvement on Running Time Experiments

FAQ

Stable Marriage Two sets O (for woman) and P (for man) For each woman o  O, there is a preference list which sorts the men in descending order of how much o loves them. For each man p  P, there is a preference list which sorts the women in descending order of how much p loves them. Stable Marriage the absence of a man p and a woman o, such that p loves o more than his current partner, and o loves p more than her current partner.

Stable Marriage Reduction to Stable Marriage For each o  O We create a preference list in ascending order of |o, p| for all p  P For each p  P We create a preference list in ascending order of |o, p| for all o  O

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates 7k3k 4k 10k Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Weighted SPM How can we perform an assignment between P and O? First, we consider an assignment A.

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates 7k3k 4k 10k Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Weighted SPM How can we perform an assignment between P and O? First, we consider an assignment A. 3k 4k 3k 4k

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates 7k3k 4k 10k Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Weighted SPM How can we perform an assignment between P and O? |p 1, o 1 | < |p 2, o 1 | First, we consider an assignment A. 4k 3k 4k (p 1, o 1 ) is a dangling pair. 3k (p, o) is a dangling pair if 1. |p, o| < the distance between o and some of its partners in A 2. |p, o| < the distance between p and some of its partners in A

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates 7k3k 4k 10k Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Weighted SPM How can we perform an assignment between P and O? |p 1, o 1 | < |p 1, o 2 | First, we consider an assignment A. (p, o) is a dangling pair if 1. |p, o| < the distance between o and some of its partners in A 2. |p, o| < the distance between p and some of its partners in A If the assignment A does NOT contain any dangling pair, then the assignment is fair. 4k 3k 4k (p 1, o 1 ) is a dangling pair. 3k |p 1, o 1 | < |p 2, o 1 | This assignment is NOT fair because we find a dangling pair.

2. Problem p3p3 p2p2 p1p1 o1o1 o2o2 o3o3 P = {p 1, p 2, p 3 } O = {o 1, o 2, o 3 } Polling places Residential estates 7k3k 4k 10k Problem: to find an assignment between P and O with the consideration of the capacity of p i  P and the population of o j  O. Spatial matching (SPM) Weighted SPM (p, o) is a dangling pair if 1. |p, o| < the distance between o and some of its partners in A 2. |p, o| < the distance between p and some of its partners in A If the assignment A does NOT contain any dangling pair, then the assignment is fair. This assignment is fair because we cannot find a dangling pair. 4k 3k 7k

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o2o2 o3o Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o2o2 o3o From o 1, find NN in P (i.e., p 1 ) Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o2o2 o3o From p 1, find NN in O (i.e., o 2 ) Since o 2 is NOT equal to o 1, (p 1, o 1 ) is not a pair of mutual NN. We need to continue the process. Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o2o2 o3o From o 2, find NN in P (i.e., p 1 ) Now, we find a pair of mutual NN (p 1, o 2 ). We can remove (p 1, o 2, 10). Assignment = { } (p 1, o 2, 10) Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o3o From p 1, find NN in O (i.e., o 3 ) Assignment = { } (p 1, o 2, 10) Since o 3 is NOT equal to o 1, (p 1, o 1 ) is not a pair of mutual NN. We need to continue the process. Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 p1p1 o1o1 o3o From o 3, find NN in P (i.e., p 1 ) Assignment = { } (p 1, o 2, 10) Now, we find a pair of mutual NN (p 1, o 3 ). We can remove (p 1, o 3, 10)., (p 1, o 3, 10) Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 o1o1 o3o From o 1, find NN in P (i.e., p 2 ) Assignment = { } (p 1, o 2, 10), (p 1, o 3, 10) Weighted SPM

3.2 Algorithm Weighted Chain p3p3 p2p2 o1o1 o3o From p 2, find NN in O (i.e., o 1 ) Assignment = { } (p 1, o 2, 10), (p 1, o 3, 10) Now, we find a pair of mutual NN (p 2, o 1 ). We can remove (p 2, o 1, 10). (p 2, o 1, 10), Weighted SPM

3.2 Algorithm Weighted Chain p3p3 o3o From o 3, find NN in P (i.e., p 3 ) Assignment = { } (p 1, o 2, 10), (p 1, o 3, 10) (p 2, o 1, 10), Weighted SPM

3.2 Algorithm Weighted Chain p3p3 o3o From p 3, find NN in O (i.e., o 3 ) Assignment = { } (p 1, o 2, 10), (p 1, o 3, 10) (p 2, o 1, 10), Now, we find a pair of mutual NN (p 3, o 3 ). We can remove (p 3, o 3, 5)., (p 3, o 3, 5) Weighted SPM