View source: R/graph_edit_distance.R
| calculate.edit.distances | R Documentation |
Calculates edit distances between pairs of graphs separated by a specified offset in the sequence of k values.
calculate.edit.distances(
k.values,
graph.data,
offset = 1,
edge.cost = 1,
weight.cost.factor = 0.1,
verbose = FALSE
)
k.values |
Numeric vector of k values corresponding to the loaded graphs. |
graph.data |
List containing graph data as produced by
|
offset |
Positive integer specifying the offset between compared graphs (default: 1). An offset of 1 compares consecutive graphs. |
edge.cost |
Cost parameter passed to |
weight.cost.factor |
Weight cost factor passed to
|
verbose |
Logical indicating whether to show progress messages (default: FALSE). |
For a sequence of k values and an offset of 1, this function compares:
Graph at k[1] with graph at k[2]
Graph at k[2] with graph at k[3]
And so on...
A list containing:
indices |
Integer vector of indices in the k.values sequence |
k.values |
Numeric vector of k values corresponding to the first graph in each comparison |
distances |
Numeric vector of calculated edit distances |
graph.data <- list(
adj.list = list(
`5` = list(c(2), c(1, 3), c(2)),
`10` = list(c(2, 3), c(1, 3), c(1, 2)),
`15` = list(c(2, 3), c(1), c(1))
),
dist.list = list(
`5` = list(1, c(1, 2), 2),
`10` = list(c(1, 2), c(1, 3), c(2, 3)),
`15` = list(c(1, 1.5), 1, 1.5)
)
)
k.vals <- c(5, 10, 15)
distances <- calculate.edit.distances(k.vals, graph.data, offset = 1)
distances$distances
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.