Computing Minimum Spanning Tree in R

  • Thread starter Thread starter valesdn
  • Start date Start date
  • Tags Tags
    Minimum Tree
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 3K views
valesdn
Messages
42
Reaction score
1
Hi guys.
Could you please give me more information regarding the necessary library and/or the code I should use to compute the Minimum Spanning Tree in R?

Many thanks.
 
Physics news on Phys.org
valesdn said:
Hi guys.
Could you please give me more information regarding the necessary library and/or the code I should use to compute the Minimum Spanning Tree in R?

Many thanks.

Hi valesdn,

if this is a homework question please post it in the appropriate section.

In any case what do you know regarding R so far?
 
Hi QuantumQuest.

Thank you for your reply.
Actually it is not a homework question. I read an article regarding analysis data and MST, so I tried to 'copy' a part of the program on a new file in R. However, I found some difficult to create the algorithm of this function in R.
I usually used this program for financial data analysis, but in a really easy way.
 
valesdn said:
Actually it is not a homework question. I read an article regarding analysis data and MST, so I tried to 'copy' a part of the program on a new file in R. However, I found some difficult to create the algorithm of this function in R.
I usually used this program for financial data analysis, but in a really easy way.

You can use igraph package for a mst. You can use it to compute mst for unweighted graphs or weighted (package runs Prim's algorithm). There is also the https://cran.r-project.org/web/packages/optrees/optrees.pdf package, which finds optimal trees in weighted graphs (minimum cost spanning tree problems, minimum cost arborescence problems, shortest path tree problems and minimum cut tree problem).
 
Thank you so much QuantumQuest.
 
I usually used this program for financial data analysis, but in a really easy way.