Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Bit-vector compression

by salva (Canon)
on Mar 02, 2022 at 12:16 UTC ( [id://11141750]=note: print w/replies, xml ) Need Help??


in reply to Bit-vector compression

Even if you are randomly flipping bits, the bit-strings are all aligned at a byte boundary, so that is actually equivalent to just randomly changing bytes in a byte-string. If that is your use case, then yes, just packing the strings and using a regular compressor would perform quite well.

On the other hand, if in your real use case bit-strings are not aligned in any way, then, compressing them as bytes is going to perform somewhat worse. Something that may work better is to use Run Length Encoding (RLE) to transform the bit-string into a byte-string that can then be compressed using regular compression algorithms.

In any case, the final result would vary greatly depending on the specifics of the bit-strings you are trying to compress and the actual number of flips. The 25% parameter you are using ensures that any bit-sequence longer than a few bits is mutated.

Replies are listed 'Best First'.
Re^2: Bit-vector compression
by baxy77bax (Deacon) on Mar 03, 2022 at 00:40 UTC
    well now when u "spell it out" to me like that i see the point.

    Thank you :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141750]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-19 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found