shd | R Documentation |
Compute the Structural Hamming Distance (SHD) between two graphs. In simple terms, this is the number of edge insertions, deletions or flips in order to transform one graph to another graph.
shd(g1,g2)
g1 |
Graph object |
g2 |
Graph object |
The value of the SHD (numeric).
Markus Kalisch kalisch@stat.math.ethz.ch and Martin Maechler
I. Tsamardinos, L.E. Brown and C.F. Aliferis (2006). The Max-Min Hill-Climbing Bayesian Network Structure Learning Algorithm. JMLR 65, 31–78.
## generate two graphs
g1 <- randomDAG(10, prob = 0.2)
g2 <- randomDAG(10, prob = 0.2)
## compute SHD
(shd.val <- shd(g1,g2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.