[IR] Graph Compression
Ref: [IR] Compression
Ref: [IR] Link Analysis
Planar Graph
From: http://www.csie.ntnu.edu.tw/~u91029/PlanarGraph.html#1
由於缺乏優美規律,因此談論對偶圖時,習慣忽略同構。

最特別的對偶圖例子,就是橋( bridge )與自環( loop )。
舉例來說,原圖是一棵樹,對偶圖是一個點以及一大堆自環;各種樹對應各種自環包覆方式。
Spanning Tree
From: http://www.csie.ntnu.edu.tw/~u91029/SpanningTree.html
图中提取树的方法,可参见:[Optimization] Greedy method 中最小生成树算法等相关内容。
以下探讨如何压缩Graph的策略。

Idea:
能表示在spanning tree上的连接使用-+方式记录信息。
未表示在spanning tree上的连接则补充balance bracket。
| 1 | 2 | 3 | 2 | 4 | 2 | 1 | 5 | 6 | 5 | 7 | 8 | 7 | 5 | |||||||||||||
| - | - | + | - | + | + | - | - | + | - | - | + | + | ||||||||||||||
| (( | )(( | (( | ) | ))( | ) | ) | ) | |||||||||||||||||||
| 1 | 6 | 7 | 3 | 1 |
最终编码形态:--((+-)((+((+-)-))(+-)-)++)
其实就是基于DFS表示tree,然后剩余的链接拿平衡括号来表达。(哄小孩儿的伎俩)
邻接矩阵,邻接链表
Each vertex associated with an (sorted / unsorted) array of adjacent vertices.
More space efficient for sparse graph.
其实就是基础的邻接表,解决稀疏信息的问题。

Web Graph representation and compression
Link: http://www.touchgraph.com/TGGoogleBrowser.html

面临的问题主要是:
• Graph is highly dynamic
– Nodes and edges are added/deleted often
– Content of existing nodes is also subject to change
– Pages and hyperlinks created on the fly
• Apart from primary connected component there are also smaller disconnected components
具有的主要特点是:
Locality: usually most of the hyperlinks are local, i.e, they point to other URLs on the same host.
The literature reports that on average 80% of the hyperlinks are local.
Consecutivity: links within same page are likely to be consecutive respecting to the lexicographic order.
Similarity: Pages on the same host tend to have many hyperlinks pointing to the same pages.
以下内容可以combined with [IR] Compression. (都具有同样类似的压缩思想)
Connectivity Server: URL compression
其实就是类似于”Front coding, 前缀冗余“的方案。

Delta Encoding of the Adjacency Lists
压缩效果:
Avg. inlink size: 34 bits --> 8.9 bits
Avg. outlink size: 24 bits --> 11.03 bits
原理:
Delta encoding is a way of storing or transmitting data in the form of differences (deltas) between sequential data rather than complete files;
more generally this is known as data differencing. Delta encoding is sometimes called delta compression,
particularly where archival histories of changes are required (e.g., in revision control software).
就是通过只记录“差别”而达到压缩的效果。

Interlist compression with representative list
ref : relative index of the representative adjacency list;
deletes: set of URL-ids to delete from the representative list; 删掉第几个data。
adds: set of URL-ids to add to the representative list. 替换为这个data。

压缩效果:
Avg. inlink size: 5.66 bits
Avg. outlink size: 5.61 bits
(WebGraph Framework)
-- 过程如下介绍
压缩效果:
Avg. inlink size: 3.08 bits
Avg. outlink size: 2.89 bits
Compressing Gaps

注意:
S1-X的值看正负,然后通过v(x)来得出Successors列的头一个值。
v(x)的值,其实:
- 若是奇数:x <0
- 若是偶数:x>=0
Using copy lists
能够使用copy方式,比如这里使用Node15 Outdegree11为基准做01序列(1:copy操作)
其他列以这一列为基准,只需保存没copy操作的即可。

但貌似在01序列中有太多的0出现,我们能不能针对性的做些什么?
Using copy blocks (
)
Feature: copy and skip是交替进行的。

这里有几个地方比较绕,开启傻瓜式的讲解方式:
Encoding:
1. The last block is omitted; 忽略最后一个block。
2. The first copy block is 0 if the copy list starts with 0; ‘01’序列start with 0,则copy block 也start with 0。
3. The length is decremented by one for all blocks except the first one.
16, 10, 1,
第一个算是个标志位,第二个0才是下面的1st block的0.
1st block: 0
2nd block: 3-1=2
3rd block: 2-1=1
4th block: 2-1=1
5th block: 1-1=0
6th block: 1-1=0
7th block: 1-1=0 // The last block is omitted;
其实,最起码,copy blocks --> copy lists。
注意,copy与skip之间是否后接自己的数字,可以利用“递增”的特性来判断!
Decoding:
copy next 2+1=3 -> 15 16 17
skip next 1+1=2 -> 15 16 17
copy next 1+1=2 -> 15 16 17 23 24 //因为递增,”22“比“23,24”小
skip next 0+1=1 -> 15 16 17 22 23 24
copy next 0+1=1 -> 15 16 17 22 23 24
copy left 0+1=1 -> 15 16 17 22 23 24 315 316 317 3041
补充:
因为 “01” 序列其实不为0,那么The first copy block is not 0。
Conclusions
The compression techniques are specialized for Web Graphs.
The average link size decreases with the increase of the graph.
The average link access time increases with the increase of the graph.
The
seems to have the best trade-off between avg. bit size and access time.
[IR] Graph Compression的更多相关文章
- [IR] XML Compression
Ref: https://www.ibm.com/developerworks/cn/xml/x-datacompression/ Language-Equivalent (类似路径压缩 ) root ...
- 本人AI知识体系导航 - AI menu
Relevant Readable Links Name Interesting topic Comment Edwin Chen 非参贝叶斯 徐亦达老板 Dirichlet Process 学习 ...
- [Code] 烧脑之算法模型
把博客的算法过一遍,我的天呐多得很,爱咋咋地! 未来可考虑下博弈算法. 基本的编程陷阱:[c++] 面试题之犄角旮旯 第壹章[有必要添加Python] 基本的算法思想:[Algorithm] 面试题之 ...
- JIT IR,C2
A Simple Graph-Based Intermediate Representation http://www.oracle.com/technetwork/java/javase/tech/ ...
- SLAM(二)----学习资料下载
有位师兄收集了很多slam的学习资料, 做的很赞, 放到了github上, 地址:https://github.com/liulinbo/slam.git ruben update 0823 2016 ...
- AI框架精要:设计思想
AI框架精要:设计思想 本文主要介绍飞桨paddle平台的底层设计思想,可以帮助用户理解飞桨paddle框架的运作过程,以便于在实际业务需求中,更好的完成模型代码编写与调试及飞桨paddle框架的二次 ...
- 实践torch.fx第一篇——基于Pytorch的模型优化量化神器
第一篇--什么是torch.fx 今天聊一下比较重要的torch.fx,也趁着这次机会把之前的torch.fx笔记整理下,笔记大概拆成三份,分别对应三篇: 什么是torch.fx 基于torch.fx ...
- [IR] Compression
关系:Vocabulary vs. collection size Heaps’ law: M = kTbM is the size of the vocabulary, T is the numbe ...
- [IR] Advanced XML Compression - ISX
Ori paper: http://www.cse.unsw.edu.au/~wong/papers/www07.pdf ISX Requirements 1 Space does matter fo ...
随机推荐
- Mac如何找到从AppStore下载的正版Xcode安装包、以及Xcode清理缓存
前言:本文介绍在Mac下如何找到AppStore下载的安装包路径,以及如何提取出来供以后使用,希望对大家有所帮助(前提:想要提取某个安装包,前提是你正在从AppStore安装这个程序.比如你想提取im ...
- Delphi发布ActiveX控件 制作CAB包 数字签名相关
文件: SignTool.rar 大小: 84KB 下载: 下载 最近我正在研究ActiveX技术.我使用Delphi 7创建了一个具有ActiveForm的ActiveX控件应用程序.这个控件产生一 ...
- JetBrains Rider 2018.1 汉化
之前说过了JetBrains系列的破解(最新版本也可以破解)https://www.cnblogs.com/dunitian/p/8478252.html 不少人对全英文的开发环境还是不太适应,那就来 ...
- 从安装node js到构建一个vue并启动它
1.安装node js 下载地址:http://nodejs.cn/download/2.安装完成后运行Node.js command prompt(node -v查看安装版本) 3.安装npm(由于 ...
- canvas应用——将方形图片处理为圆形
上段时间在项目中需要将方形图片处理为圆形图片,你可能会说直接用css设置border-radius: 50%就可以了,但是项目中还要将此图片的圆形图片作为一部分利用canvas将其绘制到一张背景图上面 ...
- Intellij IDEA 自动清除无效 import 和 清除无效 import 的快捷键 ctrl+alt+o
快捷键 ctrl+alt+o 自动清除的配置方法 可以settings-general-auto import-java项,勾选optimize imports on the fly,在当前项目下会自 ...
- 第十五章 dubbo结果缓存机制
dubbo提供了三种结果缓存机制: lru:基于最近最少使用原则删除多余缓存,保持最热的数据被缓存 threadlocal:当前线程缓存 jcache:可以桥接各种缓存实现 一.使用方式 <du ...
- C# ConcurrentBag实现
ConcurrentBag可以理解为是一个线程安全无序集合,API比我们的list要弱一点,那我们来看看它的实现: public class ConcurrentBag<T> : IPro ...
- 解密gzip压缩的网页数据流(转)
因为采集某个网页遇到问题,一直无法获取页面数据. 经过一番排查,发现该网站会检查客户端的Header信息,如果遇到不明确的Header信息就直接否定,返回0数据. 如果Header信息正确,就会返回经 ...
- 当echarts的legend字数过多的时候变成省略号
legend: { data: ['国有土地使用','食品药品安全','生态环境和资源保护','国有财产保护'], orient: 'horizontal', left: '10', bottom:' ...