Re: Data structure for finding min of set intersection
From: David Wagner (daw_at_taverner.cs.berkeley.edu)
Date: 11/18/04
- Previous message: Eray Ozkural exa: "Re: Zenkin's paper on Cantor (reply of Dr. Zenkin)"
- In reply to: Nicholas King: "Re: Data structure for finding min of set intersection"
- Next in thread: Paul E. Black: "Re: Data structure for finding min of set intersection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Nov 2004 01:45:07 +0000 (UTC)
Nicholas King wrote:
>David Wagner wrote:
>> Adam Morrison wrote:
>>>Consider the following problem: We are given $m$ subsets $S_1,...,S_m$
>>>of ${1,...,n}$. The goal is to build a data structure that supports a
>>>MIN_INTERSECTION(i,j) operation, which returns the minimum number in the
>>>intersection of $S_i$ and $S_j$.
>>
>> I presume you've thought about the idea of sorting each set in advance,
>> and then walking through the elements of S_i in order, checking for each
>> one to see whether it occurs in S_j?
>
>Having the sets sorted gives you 0(n) worst case time ,
Sure. It wasn't clear to me whether the original poster was asking
about worst case asymptotic running time in theory, or about algorithmic
techniques that might be effective (on average, etc.) in practice.
For instance, sorting the sets might run much faster than Theta(n) time
if sets are usually sparse. That's why I asked about likely parameters
settings; to speed up performance in practice, it might help to know
a little more about the common case, about the distribution on problem
instances, that kind of thing. Maybe one can do a little better for some
specific distributions on the inputs.
- Previous message: Eray Ozkural exa: "Re: Zenkin's paper on Cantor (reply of Dr. Zenkin)"
- In reply to: Nicholas King: "Re: Data structure for finding min of set intersection"
- Next in thread: Paul E. Black: "Re: Data structure for finding min of set intersection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|