View source: R/transitive_reduction.R
| identify_transitive_edges | R Documentation |
Identifies which edges in a reachability matrix are transitive (can be inferred from other paths) versus direct (essential).
identify_transitive_edges(reach_matrix, adj_matrix = NULL)
reach_matrix |
A square reachability matrix (n x n) with 0/1 entries. |
adj_matrix |
Optional. The original adjacency matrix for comparison. |
This function is useful for understanding the structure of relationships and for creating visualizations where transitive edges are shown differently (e.g., as dashed lines) from direct edges.
A data frame with columns:
from: source node index
to: target node index
from_label: source node label (if available)
to_label: target node label (if available)
type: "direct" or "transitive"
extract_direct_edges for removing transitive edges,
plot_ism for visualization.
adj <- matrix(c(0, 1, 1,
0, 0, 1,
0, 0, 0), nrow = 3, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C")
reach <- compute_reachability(adj)
edges <- identify_transitive_edges(reach)
print(edges)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.