0
我想計算完整的3節點子圖的數量。 原始圖的節點有名稱。示例代碼如下。輸出子圖的節點名稱/ ids列表(子同構)
g <- graph.full(n=5, directed = TRUE)
# adjacency matrices
d3<-matrix(c(0,1,1,1,0,1,1,1,0),nrow=3,ncol=3)
# Turn them into a convenient list
sbgDouble.mat<-list(d3)
# And then into a list of graph objects
sbgDouble.graph<-lapply(sbgDouble.mat, graph.adjacency)
# Count the number of the full 3-node subgraph
subgraph.freq.g<-c()
subgraph.freq.g[1]<-
graph.count.subisomorphisms.vf2(g, sbgDouble.graph[[1]])
#> subgraph.freq.g
# [1] 60
更新:我試圖graph.get.isomorphisms.vf2(g, sbgDouble.graph[[1]])
但結果是list()
。
有人可以請我說如何輸出3節點子圖節點的名稱/ ids列表?謝謝。