Re: Encoding/decoding ranges of unsigned integers...



d|dq wrote:
) Here is the description of a problem:
)
) Assume you have n integer ranges: [i, j], [k, l], [m, n]...
)
) There is no particular order on the sequence of ranges.
) There is no gap in any of the ranges.

In other words: It's okay to, say, sort the ranges ?
Is there a minimum and maximum value to the integers ?
Can the ranges overlap ?

) Is there a smart way to encode these ranges into a representation that
) would be both compact and efficient to encode/decode.

Sort the ranges in increasing order, calculate the differences/deltas,
encode those with an arith coder or whatever.

) Before I go about and re-invent the wheel, I would like to know if there
) is a well known algorithm to accomplish this.

It rather depends on the distribution of those ranges and other factors.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
.



Relevant Pages