Computing Minimum Spanning Tree in R

  • Thread starter Thread starter valesdn
  • Start date Start date
  • Tags Tags
    Minimum Tree
Click For 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.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
9
Views
3K
Replies
15
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 65 ·
3
Replies
65
Views
10K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K