how to compress an unsorted list of numbers?
I am working on compressing graphs. The graph is represented as an adj开发者_如何学Goacency list i.e each node in graph maintains a list of adjacent nodes. The lists contain Node_IDs(4 byte integers) and they are ordered by popularity of each Node_ID(score). So, I end with up unsorted list of Node_ID numbers and I have to compress them while maintaining their present order, to store efficiently.
Something simple would be to do a basic Huffman Encoding on the Node_IDs or even sequences of Node_IDs and convert the most common one to take up a few bits and so on.
If you can get anytime the scores by knowing the ID-s then you can store them in any order.
精彩评论