Question: specify a root in igraph minimum-spanning-tree
0
gravatar for mk
8 weeks ago by
mk20
mk20 wrote:

I have a weighted adjacency matrix and I need to create a directed MST. The problem is that I know the edge weights and the root, so I can generate an MST on an undirected graph, but I cant find a way to then specify a root. If I could specify a root, this would automatically induce directions on all the edges of the MST, completing the task.

Here is some R code:

my_graph <- igraph::graph_from_adjacency_matrix(adjmatrix = cluster_adj_matrix,
                                                   mode = "upper",weighted = TRUE)
my_mst <- igraph::mst(my_graph)                                                   

<next,  add a root>
ADD COMMENTlink modified 6 weeks ago by Biostar ♦♦ 20 • written 8 weeks ago by mk20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1945 users visited in the last hour