Questions tagged [spanning-tree]

A spanning tree in an connected, undirected graph is a subgraph that includes all vertices, is a tree and is connected.

98 questions
35
votes
2 answers

How is a minimum bottleneck spanning tree different from a minimum spanning tree?

A minimum bottleneck spanning tree of a weighted graph G is a spanning tree of G such that minimizes the maximum weight of any edge in the spanning tree. A MBST is not necessarily a MST (minimum spanning tree). Please give an example where these…
Nikunj Banka
  • 10,091
  • 15
  • 68
  • 105
25
votes
3 answers

Spanning tree which minimizes the number of vertices connected to multiple edges?

Is there an algorithm to find a spanning tree of an undirected graph which minimizes the number of vertices connected to more than one edge? For example, given a 4 x 4 grid graph, we want to find a spanning tree like that on the left (which has 7…
user200783
  • 12,313
  • 10
  • 58
  • 110
14
votes
4 answers

Difference between Hamiltonian path and ST

I was reading up algorithms for finding the minimum spanning tree(in case of weighted graphs) and for finding if a graph has a hamiltonian path(which depends on the presence of a hamiltonian cycle). I got everything messed up. So whats the…
letsc
  • 1,933
  • 4
  • 23
  • 41
10
votes
2 answers

Spanning Tree VS. Spanning Forest

What's the difference between a Spanning Tree and a Spanning Forest in graphs, conceptually. Also, is it possible to construct a Spanning Forest through DFS or BFS traversals? Why? How? I understand the Spanning Tree, but I couldn't find any clear…
8
votes
2 answers

Minimum product spanning tree with negative weights

Suppose if all the edges have positive Weights the minimum product spanning tree can be obtained by taking the log of every edge and then apply Kruskal or Prim. But if some weights are negative, we can't apply this procedure. since we need to…
8
votes
1 answer

Finding a spanning tree that minimizes sum of nodes' depths

I have an undirected connected graph with unweighted edges. How can I build a spanning tree (the solution might not be unique) such that the sum of depths of all nodes is minimized? This is obviously not finding the minimum spanning tree, as the…
klkh
  • 225
  • 1
  • 2
  • 7
8
votes
2 answers

How to find total number of minimum spanning trees in a graph?

I don't want to find all the minimum spanning trees but I want to know how many of them are there, here is the method I considered: Find one minimum spanning tree using prim's or kruskal's algorithm and then find the weights of all the spanning…
2147483647
  • 1,107
  • 3
  • 12
  • 29
6
votes
6 answers

Bidirectional spanning tree

I came across this question from interviewstreet.com Machines have once again attacked the kingdom of Xions. The kingdom of Xions has N cities and N-1 bidirectional roads. The road network is such that there is a unique path between any pair…
user1374210
  • 63
  • 1
  • 4
5
votes
1 answer

Max weight euclidean spanning tree

A maximum spanning tree can be found by running kruskal's algorithm(just changing the edges function and considering the max weight edges first). I am interested in finding the max weight euclidean spanning tree. Does there exist a better…
4
votes
1 answer

Finding a spanning tree using exactly k red edges in a graph with edges colored by red/blue in linear time

Given a graph G with red and blue edges and a constant K, devise a deterministic, linear time algorithm that finds a spanning tree of G with exactly K red edges (or returns False if such a spanning tree does not exist). What we have done so far: Let…
Rachel Bernouli
  • 223
  • 1
  • 9
3
votes
2 answers

spanning tree with exactly k colored edges

I have a connected, undirected graph with edges that are each either black or white, and an integer k. I'm trying to write an algorithm that tells whether or not a spanning tree exists with exactly k black edges (doesn't necessarily have to find the…
Rupert
  • 31
  • 1
  • 2
3
votes
1 answer

Algorithm for minimum diameter spanning tree

Given a undirected and connected graph G, find a spanning tree whose diameter is the minimum.
Rambo
  • 731
  • 1
  • 8
  • 12
3
votes
1 answer

Polynomial time algorithm for minimum variance spanning tree

Lets define the variance of a graph as the variance of its edges' weights. The task I am trying to solve is designing an algorithm which given a graph G will construct a spanning tree T with minimum variance. I am having a hard time getting the…
A.F.K.
  • 69
  • 7
3
votes
2 answers

Edge disjoint spanning trees

I have come across a question based on spanning tree i.e : what is the upper bound on the number of edge disjoint spanning trees in a complete graph of n vertices? (a) n (b) n-1 (c) [n/2] (d) [n/3] what do we mean by edge disjoint spanning…
POOJA GUPTA
  • 2,049
  • 6
  • 25
  • 50
3
votes
2 answers

Create Spanning Tree With DFS

Running the Depth First Search (DFS) algorithm over a given graph G = (V,E) which is connected and undirected provides a spanning tree. While running DFS on the graph, when we arrive to a vertex which it's degree is greater than 1 , i.e - there is…
user975343
1
2 3 4 5 6 7