对于第层的,长度最大为,其中由中的属性组成.
DGFD论文笔记(三)
1615字约5分钟
大数据算法图
2023-11-22
7. 顺序的GFD发掘(SEQUENTIAL GFD DISCOVERY)
我们将时间顺序的GFD发掘算法记作: SeqDisGFD.
这里面包含两个问题:
- SeqDis: 给定G, k和σ, 发现一个k-bounded的, 具备σ频繁的GFDs集合Σ
- SeqCover: 给定Σ, 如何计算它的一个覆盖Σc
这两个问题我们将分别在7.1和7.2两章中讨论.
7.1 Sequential GFD Mining
如果使用暴力枚举算法, 首先根据传统图挖掘算法枚举出图G中所有频繁模式Q, 然后通过增加属性来生成GFDs. 但是这种枚举k-bounded GFDs的方法在图G非常大的时候代价很大.
为了降低代价, SeqDis算法将这两个步骤合并为一个, 可以尽早地淘汰不感兴趣的GFDs.
算法在k2次迭代中运行. 对于每个迭代i, 发现并存储所有的大小为i(有i条边)且σ频繁的最小GFDs在Σi集合中. 在最初的迭代中, 初始化一个GFD生成树T, 存储只包含单点的模式的频繁GFDs. 之后通过两个方向的扩展来扩展这个树:
- 垂直扩展: 扩展模式Q
- 水平扩展: 生成依赖X→Y
每次迭代i(0<i<k2), SeqDis生成并证实GFD的候选项, 并填充在树T的第i层. 具体的操作为下面的两个步骤:
模式证实
SeqDis算法先进行垂直扩展. 在T的第i层生成一个新的图模式. 而每个图模式Q′都是由第i−1层的模式Q通过扩展一条边(或者一条边和一个新点)得到的. 然后通过模式匹配找到第i层所有模式的匹配.
GFD验证
算法随后进行水平扩展, 将一组属性与T的第i层上新验证的图形模式关联起来,以生成一组GFD候选项. 对于每一组候选项, 执行GFD验证去找到Σi中的GFDs, 即第i层上满足G, 并且是频繁的, 并且是最小的GFD. 验证过程一致持续到第i层的模式相关的所有的GFD候选项都被验证过.
这两个步骤不断迭代知道没有新的GFDs可以被生成, 或者所有的k-bouned GFDs都被遍历过.
接下来详细介绍垂直扩展和水平扩展, 算法的核心就是如何维持用来保存GFD候选项的生成树.
7.1.1 生成树
树T=(VT,ET)控制着GFD候选项的迭代.
每个在T的第i层的点v∈VT都存储着一个元组(Q[xˉ],lvec). 其中:
- v.Q[xˉ]是一个拥有i个边的图模式
- v.lvec是一个向量, 每个条目levc[l]存储着一个以属性l为根的属性树. 此时, l是x.A=c或者x.A=y.B, 其中x,y∈xˉ, 且A,B是Γ中的属性, c是G中的常量.
每个第j层的点的levc[l]是一个属性集合X, 使得Q[xˉ](X→l)是一个GFD的候选项. 对于一个属性l′来说, 如果X1=X2∪l′, 则v.levc[l]中有一个边(X1,X2).
每个点v(A[xˉ],lvec)拥有一个边(v,v′)∈ET连接到另一个点v′(Q′[xˉ],lvec′)如果Q′是由Q扩展了一条单边形成的.
上图就是一棵GFD生成树T, 展示了前文中提到过的两个GFD, 分别是:
- GFD φ1=Q1[x,y](y.type=film→x.type=producer)
- GFD φ4=Q′1[x,y,z](x.type=producer,z.name=Academy best picture→y.type=film).
该生成树就只有两个节点,第一层的节点存储了v(Q1,Q1.lvec),其中Q1是节点左边展示的图模式, Q1.lvec则是一个以x.type=producer为根的树,相当于将φ1的函数依赖存储到一棵树. 第二层的节点存储了v(Q1′,Q1′.lvec),而Q1′.lvec 以y.type=film为根节点.
因为X′′是由X′扩展一个属性得来的, 即X′′=X′∪z.name=Academy best picture, 所以X′和X′′之间存在一条边. 又因为Q1′是通过给Q1增加一条y→z的边得到的, 所以Q1到Q1′有一条边.
GFD扩展
生成树T通过不断执行下面的两个原子操作来生成新的GFD候选项.
垂直扩展(VSpawn)
垂直扩展操作VSpawn(i)会在第i层通过在第i−1层的v.Q的基础上增加一条边e来生成新的点v′.Q′. 它通过增加边(v,v′)到T, 使得T在垂直方向上扩展.
显然VSpawn(i)新增了一种图模式到T, 当1≤i≤k2. 对于第i−1层的每一个GFD φ=Q[xˉ](X→l)来说, 它通过增加一条边到Q来生成模式Q′. 例如Figure2中Q进行垂直扩展, 增加边e=(y,z)从而得到Q′.
水平扩展(HSpawn)
水平扩展通过属性和约束来生成字段. 具体来说, HSpawn(i,j)在T中的第i层, 字段树的第j层执行. 例如Figure2中HSpawn(2,j)就是发生在第2层的新图模式上. HSpawn(2,2)通过增加z.name=Academy best picture将level j=1的X′扩展到level j=2的X′′.
剪枝
- 当验证G⊨Q[xˉ](X→l)时, 水平扩展 终止.
- 当supp(Q,G)<σ时, 垂直扩展 终止,
这两条策略可以保证GFDs发现在实际应用时的可行性.
引理4
对于一个支持度高于σ的GFDs覆盖集Σc:
- Σc不包含任何的平凡GFD
- 对于任意的φ=Q[xˉ](X→l), 如果G⊨φ, 则Σc不包含φ′=Q[xˉ](X′→l)如果X⊆X
- 如果一个GFDφ=Q[xˉ](X→l)满足支持度supp(Q,G)<σ, 则Σc不包含 φ′=Q[xˉ](X′→l)如果Q≪Q′