Computing Minimum Spanning Tree in R

  • Thread starter Thread starter valesdn
  • Start date Start date
  • Tags Tags
    Minimum Tree
AI Thread Summary
To compute the Minimum Spanning Tree (MST) in R, the igraph package is recommended, as it can handle both unweighted and weighted graphs using Prim's algorithm. Additionally, the optrees package is available for more complex scenarios, such as finding optimal trees in weighted graphs, addressing minimum cost spanning tree problems, minimum cost arborescence problems, shortest path tree problems, and minimum cut tree problems. Users transitioning from basic financial data analysis to more advanced graph algorithms may find these packages particularly useful for their needs.
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.
 
Technology 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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top