A spanning tree in an connected, undirected graph is a subgraph that includes all vertices, is a tree and is connected.
Questions tagged [spanning-tree]
106 questions
1
vote
1 answer
Minimum Spanning Tree with leaves only?
I am asked to write an algorithm that finds the Minimum Spanning Tree in a graph G, but with the condition that each vertex of G be a leave in the spanning Tree T.
How can this be possible if the graph has more than 2 elements? Suppose G contains…

user1354784
- 386
- 4
- 15
1
vote
1 answer
Data format to represent spanning tree/graph theory network
So in the same way this hierarchy
Can be represented by this XML
Is there a data format…

Luke Moll
- 428
- 6
- 18
1
vote
2 answers
Algorithm for finding spanning tree with minimum range in a given graph
Given a weighted undirected graph G(v,e) with weights w(e), find the set of edges such that each pair of vertices (u,v)∈G are connected (in short, spanning tree) and the range of weights of selected edges is minimum (or the difference between the…

IronMan007
- 105
- 4
- 14
1
vote
0 answers
Why is a minimum spanning tree also a minimum bottleneck tree always?
I came across this problem in Introduction to algorithms Third Edition exercise.
So, how I proceeded was trying to contradict the situation when A minimum spanning tree has the largest edge greater than the largest edge of a bottleneck tree by cut…

Shubham Sharma
- 799
- 7
- 31
1
vote
1 answer
Writing two breadth first in method in two classes, stuck right now, advices?
So pretty much in this assignment I have to add a routine to the EdgeList and AdjMatrix objects class to return a breadth first spanning tree. The signature(s) would be:
In EdgelList: EdgeList BFSpanning();
In AdjMatrix: EdgeList BFSpanning();
But…

Joe liang
- 31
- 4
1
vote
1 answer
Graphically display the shortest path between two vertices in a graph
I wrote a program that collects at least 500 Wikipedia pages and links from these pages to other Wikipedia pages. It collects word frequencies from each webpage in order to determine the cost between two vertices(webpages) in a graph.
I am now…

James
- 69
- 1
- 1
- 7
1
vote
1 answer
Real world applications where spanning tree data structure is used
Does anyone of you know any real world applications where spanning tree data structure is used?

Sivaprasanna Sethuraman
- 4,014
- 5
- 31
- 60
1
vote
2 answers
Is the Minimum Product Spanning Tree different from a Minimum Sum Spanning Tree?
Is the Minimum Product Spanning Tree different from a Minimum Sum Spanning Tree? plz explain (with examples ,if possible).I mean,edges that add to the minimum should(?) also have the minimum product.

piyukr
- 631
- 3
- 12
- 18
1
vote
1 answer
Find the upper bound of the minimum number of spanning trees needed to cover all links in the graph
My question:
Let G(V,E) be a fully connected graph, where V is set of nodes and E is set of links.
What is the upper bound (worst case) of the minimum number of spanning trees needed to cover all the links in the graph, if the spanning trees are…

Radi Elshqerat
- 11
- 2
0
votes
1 answer
Approximation algorithm for constrained maximum spanning sub-tree for directed-graph
Given a directed graph, where each vector has a non-negative cost and each vertex has a non-negative profit, how do you find the spanning sub-tree of the graph with maximum profit? I want to constrain the cost is smaller to a given budget. I'm…

user1299689
- 11
0
votes
1 answer
How to make the result of a BFS spanning tree is shown in preorder
I'm trying to implement a BFS algorithm for homework, I find the spanning tree algorithm with BFS, the problem is that I require that the resulting spanning tree is shown in preorder. Here's my solution code:
#include…

AndrewRelex
- 1
- 1
0
votes
1 answer
How to indicate preorder of a spanning tree using the algorithm BFS
I'm doing an implementation of the BFS algorithm in c++ to find a spanning tree, the output for a spanning tree should be shown in preorder, but I have a doubt in the implementation, how I can build a tree if not exactly know how many children have…

franvergara66
- 10,524
- 20
- 59
- 101
0
votes
1 answer
Co-spanning tree
Does anyone know that what is co spanning tree. If there are some good answers then it would be really good to have an example also.

Abdul Samad
- 5,748
- 17
- 56
- 70
0
votes
2 answers
Jgrapht: how to convert a directed cyclic graph into a DAG?
One thought is run a spanning tree algorithm (e.g., Kruskal) to get the spanning tree, and then construct a new graph from the spanning tree, which is quite messy in terms of code. Looks like there is no available implementation to obtain a DAG…

Liang Lu
- 3
- 1
0
votes
1 answer
What does an illustrated undirected graph with only 1 endpoint look like?
How do you illustrate an undirected graph 4 nodes/vertexes, but have them all connected? If you divide the nodes (at any of the nodes of the graph) into two subsets, how would that work or look like?
I tried drawing the undirected graph in C…