Skip to content

Commit 08e88f6

Browse files
committed
fix: gaddi error
1 parent 870116c commit 08e88f6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/graph/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/algorithm",
3-
"version": "0.1.12",
3+
"version": "0.1.13",
44
"description": "graph algorithm",
55
"keywords": [
66
"graph",

packages/graph/src/gaddi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ const getMatchedCount = (graph, structure, nodeLabelProp, edgeLabelProp) => {
204204
nodeMap[node.id] = node;
205205
});
206206
let count = 0;
207+
if (!structure?.edges?.length || structure?.nodes?.length < 2) return 0;
207208
graph.edges.forEach(e => {
208209
const sourceLabel = nodeMap[e.source][nodeLabelProp];
209210
const targetLabel = nodeMap[e.target][nodeLabelProp];
@@ -540,7 +541,6 @@ const GADDI = (
540541
// );
541542
// 1.2. 生成上面节点对的相应相交邻居诱导子图。格式为 {'beginNodeIdx-endNodeIdx': {nodes: [], edges: []}}
542543
let intGMap = getIntersectNeighborInducedGraph(nodePairsMap, kNeighborUnits, graphData);
543-
544544
// 1.3. 使用 gSpan 算法(frequent graph mining)计算 ISIntG 的前 10 个频率最高的子结构(3-4条边)
545545
const top = 10,
546546
minSupport = 1,
@@ -797,7 +797,6 @@ const GADDI = (
797797
}
798798
}
799799

800-
801800
// prune3: 若该邻居点到 candidate 的 NDS 距离比和它有相同 label 的节点到 beginPNode 的最小 NDS 距离小,移除这个点
802801
const ndsToCandidate = ndsDist[key]
803802
? ndsDist[key]

0 commit comments

Comments
 (0)