[英]Frequent subgraph mining with igraph
R has got a package subgraphMining
, which - among other things - has implemented gSpan
. R已经有一个包
subgraphMining
,其中-除其他事项外-已经实施gSpan
。 However, it depends on the outdated igraph0
package. 但是,这取决于过时的
igraph0
软件包。
From the help ?gspan
it would look like this: 在帮助
?gspan
它看起来像这样:
library(subgraphMining)
library(igraph0)
graph1 = graph.ring(5)
graph2 = graph.ring(6)
database = array(dim=2);
database[1] = list(graph1);
database[2] = list(graph2);
# Call gspan, 80% frequency
results = gspan(database, "80%");
results
# [[1]]
# Vertices: 5
# Edges: 10
# Directed: TRUE
# Edges:
#
# [0] '1' -> '5'
# [1] '5' -> '1'
# [2] '2' -> '1'
# [3] '1' -> '2'
# [4] '3' -> '2'
# [5] '2' -> '3'
# [6] '4' -> '3'
# [7] '3' -> '4'
# [8] '5' -> '4'
# [9] '4' -> '5'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.