Questions tagged [minimum-spanning-tree]

A minimum spanning tree (MST) or minimum weight spanning tree is a spanning tree of a connected, undirected graph with the least possible weight.

A connected, undirected graph can have many different s. We can assign a weight to each edge, which is a number representing how unfavorable it is, and use this to assign a weight to a spanning tree by computing the sum of the weights of the edges in that spanning tree. A minimum spanning tree (MST) or minimum weight spanning tree is then a spanning tree with weight less than or equal to the weight of any other spanning tree. More generally, any undirected graph (not necessarily connected) has a minimum spanning forest, which is a union of minimum spanning trees for its connected components.

One example would be a cable TV company laying cable to a new neighborhood. If it is constrained to bury the cable only along certain paths, then there would be a graph representing which points are connected by those paths. Some of those paths might be more expensive, because they are longer, or require the cable to be buried deeper; these paths would be represented by edges with larger weights. A spanning tree for that graph would be a subset of those paths that has no cycles but still connects to every house. There might be several spanning trees possible. A minimum spanning tree would be one with the lowest total cost.

(Source: Wikipedia)

603 questions
0
votes
1 answer

Assigning missing edge cost to an MCST

I've come across this question while solving an old exam paper. I hardly have an idea how to tackle this problem based on the options given. Consider the following undirected graph G with some edge cost missing. Suppose the dashed edges form a…
dibyendu
  • 515
  • 1
  • 5
  • 16
0
votes
1 answer

Dijkstra/Prim Minimum Spanning Tree

Apply the Dijkstra/Prim Minimum Spanning Tree algorithm (not Shortest Paths) on the following graph starting at vertex a. I'm not too sure how I would get started with filling in those charts. This is a question for an exam practice so I want to…
0
votes
3 answers

Minimum Spanning Graph - Negative and Positive Weights

I'm having trouble understanding whether or not an MST would be a tree or not. Let's say that given a graph G = (V, E), do any subset of edges T ⊆ E that connects all vertices in V and have minimal total weight must be a tree, or can it be some…
user2978067
  • 11
  • 1
  • 3
0
votes
1 answer

How to find the amount of minimum spanning trees in a graph? Using kruskal's algorithm

I am trying to find the all the minimum spanning trees in the graph using kruskal's algorithm. I know that if all the weight of the edges that is distinct from each other, there will only be one minimum spanning tree in the graph. So, for more than…
Sirius
  • 11
  • 3
0
votes
1 answer

How should I go about checking if my graph has at least X Minimum Spanning Trees?

I am looking for an efficient algorithm for finding if at least 'X' number of MST exist in a graph. Any pointers?
Nitish Upreti
  • 6,312
  • 9
  • 50
  • 92
0
votes
0 answers

How quickly can we update a MST if we insert a new vertex and incident edges to G

I have a MST already computed and now I am trying to update it by adding a new node v to the graph and incident edges to G. My though is that we would need to compute a new MST' from the new edge till the closest vertex of the existing MST and…
Leon
  • 1,262
  • 3
  • 20
  • 41
0
votes
1 answer

Determining whether a TreeMap is equal to a Map in java

I am coding an implementation of Prim's algorithm for deriving a Minimum Spanning Tree. My Graph is a Map in which they keys correspond to the state name and the values are the edges which hold pointers to both links. Prim's…
Brian
  • 7,098
  • 15
  • 56
  • 73
0
votes
1 answer

Strategy to do something with network x - first time user,

I have a million xyzc points. I will loop through each point in python. Add it to graph as a node. Calculate its nearest neighbours using a python binding inside python Add each of its nearest neighbours to graph as nodes Add edges from point to…
0
votes
0 answers

Can I reduce the complexity of this algorithm (I'm using NGenerics)

I'm using Prim's algorithm from NGenerics to find the minimum spanning tree that connects some vertexes. That's like searching for a MST on a graph in which every vertex is connected to every other vertex, which means there's more edges than…
iCanLearn
  • 336
  • 1
  • 4
  • 17
0
votes
1 answer

Create a MST with depth-first search?

I have a symmetrical graph and created a tree with all shortest path from a random vertex to any other vertex. Can I use the tree to construct a Minimum Spanning Tree(MST)? My algorithm is similar to depth-first algorithm.
Micromega
  • 12,486
  • 7
  • 35
  • 72
0
votes
1 answer

matlab minimum spanning tree keep busy

I use the grMinSpanTree function in matlab toolbox. But, when the number of nodes is high the code execution doesn't come to an end, it remains in forever busy state. I tried a lot of samples and they all work well when number of nodes is below…
0
votes
1 answer

Network Design: Why is Minimum Spanning Tree so widely used in Network Design

Recently I am really interested in Network Design. Right now I am reading about Minimum Spanning Tree. However I cannot find more than two reasons to use it: - minimize total cost of cable used to connect all network utilities, - minimize total…
0
votes
2 answers

Prim's algorithm for dynamic locations

Suppose you have an input file: ... How can Prim's algorithm be…
Bob John
  • 3,688
  • 14
  • 43
  • 57
0
votes
1 answer

What is the logical error in my implementation of Prim's algorithm for minimum spanning tree?

#define ll long long ll prims(int n) { ll ans; vector used (n); #define INF 1000000000000LL vector min_e (n, INF), sel_e (n, -1); min_e[0]=-1*INF; ll dis=1; for(int i=0;i
user1907531
  • 99
  • 2
  • 8
0
votes
1 answer

java network accept network connection between threads

In Java, I am creating 256 threads which communicate with each other using network socket. All this 256 threads run in parallel. When a thread is spawned, it tries to connect to its neighbor threads. The list of neighbors can be arbitrary. In this…
prathmesh.kallurkar
  • 5,468
  • 8
  • 39
  • 50