Computing Minimum Spanning Tree in R

  • Thread starter Thread starter valesdn
  • Start date Start date
  • Tags Tags
    Minimum Tree
Click For Summary

Discussion Overview

The discussion revolves around the computation of Minimum Spanning Trees (MST) in R, focusing on the necessary libraries and code implementations. Participants share their experiences and seek guidance on applying MST algorithms in R, particularly in the context of data analysis.

Discussion Character

  • Homework-related
  • Technical explanation

Main Points Raised

  • One participant requests information on libraries and code for computing MST in R.
  • Another participant suggests that the inquiry may be homework-related and asks about the original poster's familiarity with R.
  • A participant clarifies that their question is not homework-related and describes their background in using R for financial data analysis.
  • It is proposed that the igraph package can be used to compute MSTs for both unweighted and weighted graphs, utilizing Prim's algorithm.
  • Additionally, the optrees package is mentioned as a resource for finding optimal trees in weighted graphs, addressing various minimum cost tree problems.

Areas of Agreement / Disagreement

Participants generally agree on the use of specific R packages for computing MSTs, but there is no consensus on the best approach or the completeness of the provided solutions.

Contextual Notes

Some participants express difficulty in creating the algorithm for MST in R, indicating potential gaps in understanding or experience with the programming language.

Who May Find This Useful

Individuals interested in data analysis using R, particularly those exploring graph theory and algorithms related to Minimum Spanning Trees.

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.
 

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
3K