Dept. of Computer Science Assignment Problems in Spatial Databases Kamiru Leong Hou, U Supervisor: Nikos Mamoulis Probation Talk:

Slides:



Advertisements
Similar presentations
Min Cost Flow: Polynomial Algorithms. Overview Recap: Min Cost Flow, Residual Network Potential and Reduced Cost Polynomial Algorithms Approach Capacity.
Advertisements

Outline LP formulation of minimal cost flow problem
Lecture 5: Network Flow Algorithms Max-Flow Min-Cut Single-Source Shortest-Path (SSSP) Job Sequencing.
§3 Shortest Path Algorithms Given a digraph G = ( V, E ), and a cost function c( e ) for e  E( G ). The length of a path P from source to destination.
1 A FAIR ASSIGNMENT FOR MULTIPLE PREFERENCE QUERIES Leong Hou U, Nikos Mamoulis, Kyriakos Mouratidis Gruppo 10: Paolo Barboni, Tommaso Campanella, Simone.
Topological Sort Topological sort is the list of vertices in the reverse order of their finishing times (post-order) of the depth-first search. Topological.
Chapter 5 Shortest Paths: Label-Correcting Algorithms
MINIMUM COST FLOWS: NETWORK SIMPLEX ALGORITHM A talk by: Lior Teller 1.
Management Science 461 Lecture 2b – Shortest Paths September 16, 2008.
MAX FLOW APPLICATIONS CS302, Spring 2013 David Kauchak.
Network Optimization Models: Maximum Flow Problems
Lectures on Network Flows
Chapter 7 Maximum Flows: Polynomial Algorithms
Graph & BFS.
Graph COMP171 Fall Graph / Slide 2 Graphs * Extremely useful tool in modeling problems * Consist of: n Vertices n Edges D E A C F B Vertex Edge.
Chapter 4 Distance Vector Problems, and Link-State Routing Professor Rick Han University of Colorado at Boulder
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Spatial Queries Nearest Neighbor Queries.
Tracking Moving Objects in Anonymized Trajectories Nikolay Vyahhi 1, Spiridon Bakiras 2, Panos Kalnis 3, and Gabriel Ghinita 3 1 St. Petersburg State University.
CS541 Advanced Networking 1 Routing and Shortest Path Algorithms Neil Tang 2/18/2009.
CSE 550 Computer Network Design Dr. Mohammed H. Sqalli COE, KFUPM Spring 2007 (Term 062)
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
1 Scheduling Crossbar Switches Who do we chose to traverse the switch in the next time slot? N N 11.
1 Shortest Path Calculations in Graphs Prof. S. M. Lee Department of Computer Science.
15.082J, 6.855J, and ESD.78J September 21, 2010 Eulerian Walks Flow Decomposition and Transformations.
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
and 6.855J The Capacity Scaling Algorithm.
The University of Hong Kong 1 Capacity Constrained Assignment in Spatial Databases Authors: Leong Hou U, University of Hong Kong Man Lung Yiu, Aalborg.
Networks and the Shortest Path Problem.  Physical Networks  Road Networks  Railway Networks  Airline traffic Networks  Electrical networks, e.g.,
Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology Tran Van Hoai.
Mehdi Kargar Aijun An York University, Toronto, Canada Discovering Top-k Teams of Experts with/without a Leader in Social Networks.
Minimum Cost Flows. 2 The Minimum Cost Flow Problem u ij = capacity of arc (i,j). c ij = unit cost of shipping flow from node i to node j on (i,j). x.
Department of Computer Science, The University of Hong Kong Continuous Monitoring Application for a Car Parking System (Part2) Presenter: Leong Hou, U.
Dijkstra’s Algorithm Supervisor: Dr.Franek Ritu Kamboj
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
MAX FLOW APPLICATIONS CS302, Spring 2012 David Kauchak.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Bipartite Matching. Unweighted Bipartite Matching.
A FAIR ASSIGNMENT FOR MULTIPLE PREFERENCE QUERIES
Assignments and matchings Chapter 12 Presented by Yorai Geffen.
Network Flows Chun-Ta, Yu Graduate Institute Information Management Dept. National Taiwan University.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
1 An Arc-Path Model for OSPF Weight Setting Problem Dr.Jeffery Kennington Anusha Madhavan.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …). Determine a path of shortest.
Example Apply hierarchical clustering with d min to below data where c=3. Nearest neighbor clustering d min d max will form elongated clusters!
EMIS 8374 The Ford-Fulkerson Algorithm (aka the labeling algorithm) Updated 4 March 2008.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
CSE 373: Data Structures and Algorithms Lecture 21: Graphs V 1.
1 1 Slide © 2005 Thomson/South-Western Chapter 9 Network Models n Shortest-Route Problem n Minimal Spanning Tree Problem n Maximal Flow Problem.
St. Edward’s University
Shortest Path from G to C Using Dijkstra’s Algorithm
Lectures on Network Flows
Nearest Neighbor Queries using R-trees
Dijkstra’s Algorithm with two levels of buckets
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Lecture 19-Problem Solving 4 Incremental Method
Graph Indexing for Shortest-Path Finding over Dynamic Sub-Graphs
Algorithms (2IL15) – Lecture 7
and 6.855J March 6, 2003 Maximum Flows 2
離散數學 DISCRETE and COMBINATORIAL MATHEMATICS
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
CSE 550 Computer Network Design
Shortest Path Solutions
Fast Min-Register Retiming Through Binary Max-Flow
Presentation transcript:

Dept. of Computer Science Assignment Problems in Spatial Databases Kamiru Leong Hou, U Supervisor: Nikos Mamoulis Probation Talk:

Dept. of Computer Science Outlines  Spatial Assignment Problems  Applications  Continuous Exclusive Closest Pair Monitoring  Problem Definition  Examples of the solutions  Experiments  Capacity Constrained Assignment Problem  Problem Definition  Solutions  Discussion

Dept. of Computer Science Spatial Assignment Problems  Given two sets of objects, find the k 1 to k 2 assignments between these two sets with 1.minimizing the cost from one set of objects, which is named as stable assignment 2.minimizing the total cost, which is named as optimal assignment  Both cost might be measured by the distance in spatial applications

Dept. of Computer Science Spatial Assignment Problems Stable Assignment Spatial Assignment Problems Optimal Assignment Set A Set B

Dept. of Computer Science Stable Assignment  It is a variant of stable marriage problem  `stable matching’ means  a matching in which no element of the first matched set prefers an element of the second matched set that also prefers the first set element. a b cd {b,c} is a stable matching since both b and c cannot find an element o i of the other matched set which dist(o i,b/c)<dist(b,c) and dist(o i,b/c)<dist(o i,o i.assigned-object) a b cd

Dept. of Computer Science Stable Marriage Problem  Stable Marriage Problem can be solved by [Gale62][Gusfield89] menpreference m1m1 w 2, w 3, w 1 m2m2 w 1, w 2, w 3 womenpreference w1w1 m 1, m 2 w2w2 m 2, m 1 w3w3 womensuggested man w1w1 w2w2 w3w3 mensuggested woman w2w2 w1w1 m1m1 m2m2 m1m1 m2m2 In general, stable marriage problem is asymmetric The results can be symmetric if the preference lists are symmetric

Dept. of Computer Science Optimal Assignment  It consists of finding a maximum (minimum) weight matching in a weighted bipartite graph. a b cd The pairs {a,c} and {b,d} are the best assignment with the minimum total distance a b c d

Dept. of Computer Science slot aslot b Application 1  Given a set of cars and a set of parking slots, which of the followings is the best way to assign the slots to the cars? 1.Stable Assignment 2.Optimal Assignment please go to slot a please go to slot b

Dept. of Computer Science slot aslot b Application 1  Given a set of cars and a set of parking slots, which of the followings is the best way to assign the slots to the cars? 1.Stable Assignment 2.Optimal Assignment please go to slot b please go to slot a Can I park in? Sorry, no!

Dept. of Computer Science Application 2  Given a set of wireless routers and a set of clients, which of the followings is the best way to let the routers serve the clients? 1.Stable Assignment 2.Optimal Assignment each router can serve at most 2 clients No signal

Dept. of Computer Science  Given a set of wireless routers and a set of clients, which of the followings is the best way to let the routers serve the clients? 1.Stable Assignment 2.Optimal Assignment Application 2 each router can serve at most 2 clients

Dept. of Computer Science Conclusion  Both problems in spatial database have received little attention in the past  Although both can be solved by some existing algorithms, they are not optimized by the spatial features

Dept. of Computer Science Continuous Exclusive Closest Pair Monitoring

Dept. of Computer Science Exclusive Closest Pair  For the datasets (A, B)  Run CP(A,B) = {(a,b)}  A=A-{a}, B=B-{b}  Repeat this process until A or B is empty  ECP can be solved by stable marriage algorithm  Too many computations

Dept. of Computer Science Memory Based Solution  CPM (conceptual partitioning monitoring) is the state of the art technique for NN searching  which can be used by incremental solution of ECP U3U3 U2U2 U1U1 L3L3 L2L2 L1L1 L0L0 U0U0 q D0D0 R0R0 R1R1 R2R2 R3R3 D1D1 D2D2 D3D3 o1o1 o2o2 o3o3 First NN has been found, stop? No, since dist(q, o 1 )>mindist(q, next cell) Continue to search~~

Dept. of Computer Science Solution 1  Drawback  Each a i should use a priority queue to store the searching order  If |a| is very large, then there are too many priority queue a1a1 b1b1 a2a2 (a 1,b 1 ) must be our result Remove a 1 and b 1 Enlarge the searching distance, until find all assignments b2b2

Dept. of Computer Science Solution 2  Drawback  There might have a lot of false alarms too many candidates are found, but too less results can be confirmed a1a1 a2a2 b1b1 b2b2 (a 1,b 1 ) and (a 2,b 2 ) are the candidates of the ECP (a 1,b 1 ) is the result, since b 1 also sees a 1 as its NN (a 2,b 2 ) is not sure, since b 2 sees a 1 as its NN

Dept. of Computer Science Discussion  The drawback of solution 1  too many priority queue if there are too many objects in A  The drawback of solution 2  less results are found in late iterations  Hybrid Solution  Run solution 2 first, then run solution 1 The number of A should be reduced by solution 2 The solution 2 does not need to run into the late iterations

Dept. of Computer Science Experiments Grid size: 128x128 Strip size: 16 Grid size: 128x128 Strip size: 16

Dept. of Computer Science Update module  We focus on the car-parking slot assignment  Run Hybrid solution in the initial state  Monitor the results by the update module  Observation slot a Timestamp 1 please go to slot a Timestamp 2 The distance between the assignment is shorter by time to time slot b please go to slot b The assignment should be changed if and only if the car can find a better slot

Dept. of Computer Science Update module  Find a better assignment for the assigned cars  If there is any, then change the original assigned slot as empty and set the new slot as assigned  Run Hybrid solution to all unassigned cars (which are asking for park) and all empty slots

Dept. of Computer Science Update module s3s3 s1s1 c2c2 c1c1 c 1 cannot change the assignment to s 3 c 2 can change the assignment to s 3, let s 2 as empty slot s2s2 Repeat to run until no more empty slot Optimization 2 Optimization 1 swsw cwcw Assume that (s w,c w ) is the worst assignment in last iteration Terminate the search, since dist(s f,next cell)>worst dist s f does not need to scan c 1, since dist(s f, cell c1 )>dist(s 1,c 1 ) sfsf s1s1 c1c1 sfsf s2s2 c2c2

Dept. of Computer Science Experiments |C|: 40k (number of unassigned cars) |S_f|: 20k (number of empty slots) |C|: 40k (number of unassigned cars) |S_f|: 20k (number of empty slots)

Dept. of Computer Science Capacity Constrained Assignment Problem

Dept. of Computer Science Capacity Constrained Assignment  Given a set of queries, a set of objects and a parameter k  Find the assignments between queries and objects with minimum cost (distance), such that  Each query can assign to at most k objects  Each object can assign to at most 1 query

Dept. of Computer Science Related works  It is one variant of the optimal assignment  Some existing algorithms  Hungarian Algorithm  Cost Scaling Algorithm  Successive Shortest Path Algorithm (SSPA)

Dept. of Computer Science 0, 1/2 -4, 1 0, 1 d ij, x ij /c ij Flow Network 0, 1/2 4, 1/1 8, 0/1 0, 1/1 0, 0/2 6, 0/15, 0/1 0, 0/1 ij Flow Network d ij, r ij 8, 1 0, 1 0, 2 6, 15, 1 0, 1 ij Residual Network 0, 1 d ji =-d ij r ij =c ij -x ij r ji =x ij arc ij exists if r ij >0 d ji =-d ij r ij =c ij -x ij r ji =x ij arc ij exists if r ij >0 d ij, x ij /c ij ED 0, 2/2 4, 1/1 8, 0/1 0, 1/1 0, 0/2 6, 1/1 5, 0/1 0, 1/1 ij Flow Network -4, 1 0, 2 d ij, r ij ED 8, 1 0, 1 0, 2 -6, 15, 1 0, 1 ij Residual Network Minimum Cost Maximum Flow 1 to 2 assignment

Dept. of Computer Science Optimal Assignment a b c d e Queries Objects d(i,j), r ij ij 6, 1 4, 1 8, 1 3, 1 7, 1 5, 1 ED 0, 2 0, 1 Each query can assign to at most 2 objects Add one exceed node and one deficit node Exceed node have arcs to all queries with cost=0 and capacity k=2 All objects have arcs to deficit node with cost=0 and capacity 1 The number of flows from exceed node to deficit node is min{k|Q|,|O|}

Dept. of Computer Science SSPA a b c d e 6, 1 4, 1 8, 1 3, 1 7, 1 5, 1 ED 0, 2 0, 1 (1) Find the shortest path from exceed node to deficit node (2) Send a flow from exceed node to deficit node, and update the graph a b c d e 6, 1 4, 1 8, 1 -3, 1 7, 1 5, 1 ED 0, 2 0, 1 (3) Repeat (1), until no more augmenting path can be found The number of augmenting paths is min{k|Q|, |O|} a b c d e 6, 1 4, 1 8, 1 -3, 1 7, 1 5, 1 ED 0, 2 0, 1

Dept. of Computer Science How to find shortest path?  Dijkstra algorithm is an efficient algorithm to find the shortest path  but it does not allow negative value on the arc  since the negative value may affect the correctness of the Dijkstra algorithm b a c d S={(a,0)}, a is labeled 2.S={(d,5),(b,10)}, d is labeled 3.S={(e,8),(b,10)}, e is labeled (PROBLEM) e 3

Dept. of Computer Science How to find shortest path?  Use reduced cost (d’ ij ) to solve this problem  For every path, the reduced cost can be defined as follows:  d’ ij =d ij -p(i)+p(j)  p(i)=p(i)-mindist(i)+mindist(D) For all node i which are labeled by the Dijkstra algorithm p is the potential value of node i  At the beginning, all p(i)= a b E c d D a b E c d D a b E c d D a, b, and c are labeled by Dijkstra p(a)=p(a)-0+2=2 p(b)=p(b)-0+2=2 p(c)=p(c)-2+2=0 p(a)=p(a)-2+3=3 p(b)=p(b)-0+3=5 p(c)=p(c)-2+3=1 p(d)=p(d)-3+3=0

Dept. of Computer Science SSPA d ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 q1q q2q q3q q1q1 q2q2 q3q3 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 (1) Labeled objects = {q 1,q 2,q 3,o 4 } p(q 1 )=p(q 1 )-mindist(q 1 )+mindist(D)=0-0+7=7 p(q 2 )=p(q 2 )-mindist(q 2 )+mindist(D)=0-0+7=7 p(q 3 )=p(q 3 )-mindist(q 3 )+mindist(D)=0-0+7=7 p(o 4 )=p(o 4 )-mindist(o 4 )+mindist(D)=0-7+7= (2) Labeled objects = {q 1,q 2,q 3,o 3 } p(q 1 )=p(q 1 )-mindist(q 1 )+mindist(D)=7-0+2=9 p(q 2 )=p(q 2 )-mindist(q 2 )+mindist(D)=7-0+2=9 p(q 3 )=p(q 3 )-mindist(q 3 )+mindist(D)=7-0+2=9 p(o 3 )=p(o 3 )-mindist(o 3 )+mindist(D)=0-2+2= (3) Labeled objects = {q 1,q 2,q 3,o 2 } … Each query can assign to at most 2 objects

Dept. of Computer Science SSPA d ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 q1q q2q q3q q1q1 q2q2 q3q3 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 (4) Discovered objects = {q 1,q 2,q 3,o 1,o 2 } p(q 1 )=p(q 1 )-mindist(q 1 )+mindist(D)=11-0+9=20 p(o 1 )=p(o 1 )-mindist(o 1 )+mindist(D)=0-9+9=0 p(q 2 )=p(q 2 )-mindist(q 2 )+mindist(D)=11-8+9=12 p(o 2 )=p(o 2 )-mindist(o 2 )+mindist(D)=0-8+9=1 p(q 3 )=p(q 3 )-mindist(q 3 )+mindist(D)=11-0+9= Each query can assign to at most 2 objects 8

Dept. of Computer Science SSPA-Range  It is unnecessary to calculate all distances before we run the SSPA  Assume that we run a range search with a threshold ε  Run the Range-Search(ε) for all queries  Run SSPA Find the shortest path Fill the flow only when it can be guaranteed as a shortest path, otherwise, break  ε = ε+k

Dept. of Computer Science SSPA-Range q1q1 q2q2 q3q3 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o Each query can assign to at most 2 objects ε=10 ε=15 d’ ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 p q1q q2q q3q p d ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 q1q q2q q3q E->q 3 ->o 4 ->D must be the shortest path dist(E->q 3 ->o 4 ->D)=7  ε (1) Labeled objects = {q 1,q 2,q 3,o 4 } … E->q 2 ->o 3 ->D must be the shortest path dist(E->q 2 ->o 3 ->D)=2  ε-7 (the highest p) (2) Labeled objects = {q 1,q 2,q 3,o 3 } … E->q 2 ->o 2 ->D must be the shortest path dist(E->q 2 ->o 2 ->D)=2  ε-9 (the highest p) (3) Labeled objects = {q 1,q 2,q 3,o 2 } …

Dept. of Computer Science SSPA-Range d ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 q1q q2q q3q ε=20 E->q 1 ->o 1 ->D must be the shortest path dist(E->q 1 ->o 1 ->D)=9  ε-11 (the highest p) (4) Labeled objects = {q 1,q 2,q 3,o 1,o 2 } … d ’ ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 p q1q q2q q3q p dir  d ’ ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 p q1q q2q q3q p dir 

Dept. of Computer Science SSPA-Range  Repeat the above steps, until find all assignments  It saves I/O accesses (only 30 objects are discovered by range- search) in this example, and it can save more if there are more objects and queries d ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 q1q q2q q3q ε=35

Dept. of Computer Science SSPA-INN q1q1 q2q2 q3q3 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o Each query can assign to at most 2 objects E->q 3 ->o 4 ->D must be the shortest path dist(E->q 3 ->o 4 ->D)=7  possible mindist = 7 (1) Labeled objects = {q 1,q 2,q 3,o 4 } … First, run NN search for all queries E->q 2 ->o 3 ->D must be the shortest path dist(E->q 2 ->o 3 ->D)=2  possible mindist = 2 (2) Labeled objects = {q 1,q 2,q 3,o 3 } … Find next NN for query q 3 Find next NN for query q 2 E->q 2 ->o 2 ->D must be the shortest path dist(E->q 2 ->o 2 ->D)=2  possible mindist = 2 (3) Labeled objects = {q 1,q 2,q 3,o 2 } … d’ ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 p q1q q2q q3q p

Dept. of Computer Science 11 SSPA-INN 11 0 q1q1 q2q2 q3q3 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o Each query can assign to at most 2 objects E->q 1 ->o 2 ->q 2 ->o 1 ->D is not the shortest path dist(E->…->D)= 10 > mindist = 8 Find next NN for query q 2 E->q 1 ->o 1 ->D must be the shortest path dist(E->q 1 ->o 1 ->D)=9  mindist = 9 (4) Labeled objects = {q 1,q 2,q 3,o 1,o 2 } … Find next NN for query q 1 d’ ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 p q1q q2q q3q p

Dept. of Computer Science Discussion  It saves 8/35 I/O accesses in the above example, which is more than SSPA-RANGE  SSPA-INN should be better than SSPA-RANGE, since it accesses the index tree only when it is necessary d ij o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 o7o7 q1q q2q q3q The objects have been searched before terminated the SSPA-INN

Dept. of Computer Science SSPA-INN-PRUNING  Observation Assigned in previous iteration Running NN search Does not need to search in blue area Since dist(q b,o a )+dist(q a,o i )  dist(q a,o a )+dist(q b,o i ) which o i is the objects in blue area Does not need to search in blue area Since dist(q b,o a )+dist(q a,o i )  dist(q a,o a )+dist(q b,o i ) which o i is the objects in blue area qaqa qbqb oaoa oioi ococ

Dept. of Computer Science SSPA-INN-PRUNING qaqa qbqb oaoa obob ococ Find next NN in blue area Find next NN in red area M1M1 M2M2 M3M3 m1m1 m2m2 m3m3 m4m4 m5m5 m6m6 m7m7 m8m8 m9m9 …

Dept. of Computer Science Conclusion  Three algorithms have been introduced to solve the capacity constrained assignment problem  SSPA-RANGE  SSPA-INN  SSPA-INN-PRUNING  All these algorithms aim to reduce the number of I/O accesses and optimize with spatial features  The experiments have not finished yet

Dept. of Computer Science Kamiru

Dept. of Computer Science Kamiru