工程实践经验
事实上工程中都较大, 所以计算复杂度非常高, 需要额外的剪枝策略来提高计算效率.
2326字约8分钟
大数据算法图
2023-11-08
我们重新回顾GFDs的三个关键问题:
满足性问题(Satisfiable)
是否存在一个图数据, 能满足所有GFDs.
蕴含问题(Implication)
判断一个GFD是否能被一个GFDs的集合推导出来. 对于判断多余的GFDs来说很有必要.
比如:
Q[x,y,z](x.A=y.B∧x.C=z.D→L)和Q[x,y,z](x.A=y.B→L), 明显第二个可以推出前一个, 所以第一个是多余的.
验证问题(Validation)
判断一个GFDs集合能否满足一个特定的图数据G
和满足性问题的区别在于此处的G是给定的, 而满足性问题里面的G是任意的, 存在即可.
提示
satisfiablilty, implication和validation三个问题分别是coNP-complete, NP-complete以及coNP-complete问题
对于一个可以参数化的问题P是一对(x,k), 其中x在传统的复杂性理论中表示输入, k是表征x结构的参数. "固定参数的易解性"是指: 当存在一个函数f和一个算法可以在O(f(k)⋅∣x∣c) 的时间内计算出任意一个(x,k)实例, 其中c是一个常量. 显然, 当k的值比较小的时候, 我们是可以有效地计算出问题的答案的, 虽然f(k)本身可能是指数增长的.
工程实践经验
事实上工程中k都较大, 所以计算复杂度非常高, 需要额外的剪枝策略来提高计算效率.
对于一个集合的GFDsΣ, 我们使用k来表示Q中xˉ的向量长度, 即max(∣xˉ∣), 我们可以将蕴含问题用k表示为:
k-bounded GFDs
模式Q[x]ˉ是k-bounded
当其满足∣xˉ∣≤k, k是一个常量.
当其中所有的Q[xˉ](X→Y)中的Q[xˉ]都是k-bounded
时, 一个GFDs的集合Σ是k-bounded
给定一个图G, 挖掘目标为找到一个GFDs的集合Σ, 使得G⊨Σ.
当然, 我们并不希望计算出所有的GFDs, 因为中间有很多平凡的和重复的GFD. 我们希望计算出的GFDs是
我们先来定义一下不平凡和简化的GFDs.
一个GFD φ=Q[xˉ](X→l)是平凡的有两种情况
reduced pattern
给定一个模式Q[xˉ](VQ,EQ,LQ,μ)和Q′[xˉ′](VQ′,EQ′,LQ′,μ′), 如果Q是通过Q′减少点(或者边)亦或者是将Q′中的一些label变为通配符得到的, 那么我们称Q简化了Q′, 记作Q[xˉ]≪Q′[xˉ′]. 这意味着Q是Q′拓扑结构相同, 但是约束更少的版本.
pivot
在一个图模式Q[xˉ]中, 指定一个变量z∈xˉ并将其指定为Q的pivot. 我们使用pivot来探讨子图同构问题的数据局部性.
对于G中任意的v, 如果存在h使得h(z)=v, 则h(xˉ)只包含dQ跳以内的点. 其中dQ我们称之为Q的"半径", 即z到Q中任意点的最长的最短路径(the longest shortest path).
在工程实践中, pivot一般配置为用户最感兴趣的点.
如果不清楚the longest shortest path的定义, 可以查看: longest-shortest-path-in-an-undirected-unweighted-graph
结论
如果φ1=Q1[x1ˉ](X1→l1), φ2=Q2[x2ˉ](X2→l2). 显然, 当Q1≪Q2并且X1≪X2时, φ1≪φ2.
当所有的φ∈Σ,Σ≡Σ\{φ}, 即Σ不包含任何多余的GFDs的时候, 我们称Σ是minimal(最小的).
图G上Σ的一个覆盖集合Σc是一个Σ的一个子集, 满足:
这说明Σc不包含任何无趣的多余的GFDs.
support的传统定义
对于GFD φ=Q[xˉ](X→)Y, φ的surport为Q在G中匹配并满足X→Y的数量.
但是这个定义并不是反单调性的. 例如说Q[xˉ]表示一个点person, Q′[x,y]表示一个边从personx 到persony label是hasChild. 在现实生活中, 我们会发现即便Q是Q′的一个子集, Q′的数量是远远大于Q的数量的, 因为一个人可能有多个孩子.
我们会发现, 当我们的限制增多了之后, 匹配的数量不仅没有减少, 反而增多了.
为此, 我们给出新的定义:
Pattern support(模式支持度)
对于一个图G, 和一个正向GFDφ拥有模式Q[xˉ], 其中Q有pivotz. 用Q(G,z)表示由h(z)推导出来的匹配z的节点的集合, 其中h(z)是Q在G中所有的匹配.
模式Q的support
supp(Q,G)=∣Q(G,z)∣
这个公式量化了实体在G中满足拓扑结构Q且以z为pivot的频繁程度.
pivot的作用
为了GFDs support的反单调性, 我们在上述的定义中引入了pivot的概念. 反单调性允许我们沿着与传统数据挖掘相同的路线加速挖掘过程.
为了量化在Q[xˉ]中属性的依赖程度, 我们定义correlationρ(φ,G)如下:
Correlation measure(相关度)
ρ(φ,G)=∣Q(G,z)∣∣Q(G,Xl,z)∣
这里的Q(G,Xl,z)表示Q(G,z)的子集以至于h(xˉ)⊨X并且h(xˉ)⊨l (前文曾提到过: φ=Q[xˉ](X→l)).
φ的支持度定义为: supp(φ,G)=supp(Q,G)∗ρ(φ,G)=∣Q(G,Xl,z)∣
定理3
对于任何图G和非平凡的正向GFDs φ1和φ2, 如果φ1≪φ2则supp(φ1,G)≥supp(φ2,G)
由于负的GFDs无法被满足, 所以无论如何都有Q(G,Xl,z)=∅, 则不再使用Q(G,Xl,z)=∅来定义负的GFDs的支持度.
现实生活中只关心有正向GFDs通过增加一步垂直扩展或水平扩展所变成的负GFDs, 则负的GFDs 的支持度定义为:
supp(φ,G)=maxφ′∈Φ′(supp(φ′,G))
如果supp(φ,G)≥σ, 其中σ是一个支持度阈值, 则说GFD φ是频繁的
Open World Assumption(OWA)
OWA指出, 不存在的数据不能作为知识库中的反例.
我们将GFDs的挖掘问题表述为:
验证问题和蕴含问题被包含在GFD的挖掘过程中, 对应步骤: 检查G⊨φ和计算一个k-bounded GFDsφ的覆盖集Σc
我们使用k这个参数来平衡挖掘过程和对GFDs解释的复杂性. 因为显然地:
工程实践经验
真实的数据分析中我们会精心挑选参与计算的属性, 我们通常会选择属性集合Γ.
Γ通常是我们最感兴趣的属性或者是我们认为最"干净"的, 可信任度最高的数据.