Later today, I'll be giving a talk at the 2nd Barriers Workshop in Princeton.
Sunday, August 29, 2010
Barriers 2
Posted by
Mihai
at
12:20 PM
6
comments
Thursday, August 26, 2010
IOI: A Medium Problem
Here is another, medium-level problem from the IOI. (Parental advisory: this is not quite as easy as it may sound!)
Posted by
Mihai
at
11:26 PM
22
comments
Sunday, August 22, 2010
IOI: Another Hard Problem
You are given a matrix A[1..N][1..M] that contains a permutation of the numbers {1, ..., NM}. You are also given W≤N and H≤M. The goal is to find that rectangle A[i ... i+W][j ... j+H] which has the lowest possible median.
Posted by
Mihai
at
7:54 PM
20
comments
Friday, August 20, 2010
IOI: The Hard Problem
The International Olympiad in Informatics (IOI 2010) is taking part this week at the University of Waterloo, Canada.
Posted by
Mihai
at
8:09 AM
9
comments
Wednesday, August 4, 2010
A taxonomy of range query problems
- existential range queries: Is there any point in the rectangle?
- counting queries: How many points are there in the rectangle?
- reporting queries: List the points in the rectangle. Unlike the previous cases, the query time is now broken into two components: it is usually given as f(n) + k*g(n), where k is the number of output points.
- weighted counting: What is the total weight of the points inside?
- range min (max) query
- range median query. (Possible generalizations: selection or quantiles.)
- top-k reporting: Report just the top k guys, by priority (for k given). One may demand the output to be sorted. More stringently, one may ask the query algorithm to enumerate points sorted by priority, in time g(n) per point, until the user says "stop."
- colored counting: How many distinct colors are in the rectangle?
- colored reporting: List the distinct colors in the rectangle (possibly with one example point from each color).
- top-k colored reporting: If the colors are sorted by priorities (e.g. I prefer points of color 1 over points of color 2), one can then ask for the top-k distinct colors inside the rectangle.
- static: Preprocess the point set and then answer queries.
- dynamic: Insert and delete from the point set.
- incremental / decremental: We only insert or delete.
- offline: The sequence of operations is known in advance. This is enough for many applications to algorithms.
- parametric / kinetic. I confess ignorance with respect to these.
- dominance queries: the box is [0, b1]×···×[0, bd]. In other words, we are asking for the points dominated, coordinate-wise, by a point (b1, ..., bd).
- k-sided queries: exactly 2d-k values in (a1, a2, ..., ad) are zero. For instance, a 3-sided query in 2D is a rectangle with one side on the x axis. Dominance queries are the special case of d-sided queries.
- general universe. In the standard RAM model, we assume that the coordinates are integers that fit in a machine word.
- rank space: the coordinates are from {1, 2, ..., n}. One can reduce any static problem to rank space by running 2d predecessor queries. Most problems can be shown to be at least as hard as predecessor search, so their complexity is precisely: "optimal cost of predecessor search" + "optimal cost for the problem in rank space". In other words, for most problems it is sufficient to solve them in rank space.
- dense universe: the points are exactly the points of the grid [1, n1]×···×[1, nd] where n1n2···nd = n. In 1D this is the same as rank space, but in 2 or more dimensions the problems are very different. (To my knowledgeable readers: Is there a standard name for this case? For counting queries people call this "the partial sums problem", but how about e.g. min queries?)
- intersection queries: analyze the set of input rectangles that intersect the query rectangle.
- containment queries: analyze the set of rectangles that contain / are-contained-by the query.
- orthogonal segment intersection: Given a set of horizontal segments, find the ones that intersect a vertical query segment.
- orthogonal ray shooting: Given a set of horizontal segments, find the lowest one immediately above a query point. In other words, consider a vertical ray leaving from the point and find the first segment it intersects. (This is the min segment intersection query, where the priority of each horizontal segment is its y coordinate.)
- balls
- arbitrary lines
- half spaces
- simplices (e.g 2D triangles).
Posted by
Mihai
at
1:12 PM
9
comments
Thursday, July 22, 2010
SODA
Being on the SODA PC is excruciating. Too many submissions are at the level of a hard exercise – things that David Karger would assign in Advanced Algorithms or Randomized Algorithms as homework. And since I'm a problem solver by nature, I cannot resist solving the problems before (in lieu of) reading the papers...
Posted by
Mihai
at
9:13 AM
25
comments
Monday, June 21, 2010
3SUM Puzzle
A puzzle courtesy of Mohan Paturi:
Posted by
Mihai
at
10:27 PM
9
comments