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
0
votes
1 answer
First time visited nodes form a spanning tree that has a same number of edges in both BFS and DFS
I am trying to state, whether the statement is true:
During a DFS/BFS, first time visited nodes form a spanning tree, that has the same number of edges whether you use DFS or BFS.
Is it true? Thanks!
user11516439
0
votes
0 answers
How should the function "isSpanningTree()" look like?
Write a program that simulates a positional game, such as the connectivity game, between a given number of players.
At the beginning of the game the board contains all the edges of a complete graph with n vertices (all the pairs formed with distinct…

AdryL
- 33
- 3
0
votes
1 answer
Definition of a spanning tree
I want to check if my understanding of a spanning tree (for undirected and connected graphs) is correct.
From, what I have read online. A spanning tree is a subset of a graph, it contains the same amount of vertices of the graph, however it has a…

ViB
- 65
- 8
0
votes
0 answers
Is it possible to filter relationships using it's properties in apoc.path.spanningTree()?
I need to get a spanning tree from a node. Relationships have numeric update_time property. The spanning tree should contain only the recent relationships (update_time >= period_start). I tried to use apoc.path procedures, but it seems that they do…

Rob Yart
- 323
- 1
- 2
- 13
0
votes
1 answer
How to write a recursive function in Python?
I have an undirected graph, and I want to iteratively remove each serial edge and replace it with a new edge. The weight of the new edge represents the number of spanning trees, and should be computed as follows: T_new = (1/a+b) * T_old, where a…

learner
- 33
- 7
0
votes
4 answers
C: How deallocate memory for spanning tree?
I have a n-ary tree structure with only parents and children. The spantree itself holds only one node, the root. Then there are created nodes which are linked with other nodes or the root. Each node(root included) are allowed to have up to…

Pithikos
- 18,827
- 15
- 113
- 136
0
votes
0 answers
Python: How to find the MAXIMUM spanning tree of a graph
I found this neat Kruskal's algorithm implementation, and now I would like to 'invert' it, so that it produces a maximum spanning tree instead of the minimum spanning tree. I was naïve enough to try changing if rank[root1] > rank[root2]: to if…

Tamataan
- 1
- 2
0
votes
1 answer
Trying to plot Spanning tree in Matlab
I am trying to plot, like the title already says, a spanning tree.
But I am getting following error if I try to plot my graph:
Error using rng
Too many input arguments.
Error in matlab.internal.graph.MLGraph/forceLayout>layoutOneConnComp (line…

CMW
- 1
- 1
0
votes
0 answers
Finding the slimmest Spanning Tree
This is basically an ICPC Tokyo regional question - Slim Span(UVA -1395)
Link to the question-https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4141
The question states that the slimmest tree is one with…

creed
- 63
- 1
- 9
0
votes
1 answer
Using SDN for testing purposes
I need to сheck for compliance a physical switch which uses RSTP. And instead of building a real topology I've decided to use SDN (mininet) and include my real device to SDN topology. By 'testing' I mean Conformance Test, Root Election Test, Loop…

Alexandr
- 155
- 2
- 3
- 13
0
votes
1 answer
Minimum subtree on xml with XDocument
I have xml document that needs to be proceeded using XDocument
…

marcinn
- 1,879
- 2
- 22
- 46
0
votes
1 answer
Spanning Trees with minimum number of leaves
So my problem is the following:
I have an undirected (complete) weighted graph G=(V,E), and I would like to generate all the possible spanning trees with minimum number of leaves, i.e. with minimum number of vertices of degree 1. Let's call this…

user7427473
- 3
- 1
- 2
0
votes
0 answers
Number of spanning tree in a grid graph
I'm having some issue trying to solve this problem:
How many different spanning trees does the (grid graph) M 2,4 have?
Can someone explain me how to find this number?
(I didn't see Kirchhoff theorem or Matrix tree in class so I shouldn't use them)…

nvmb3r
- 9
- 1
0
votes
1 answer
Adjacent spanning trees property
I need to show that, given a connected graph with distinct weights for every edge, every spanning tree (except from the minimum spanning tree) has an adjacent spanning tree with a smaller weight.
w(T') < w (T), where T' is adjacent to the spanning…
user6338331
0
votes
1 answer
STP hello timer
In STP we have the MAX age timer. It tells us how long to wait for a superior BPDU (On root or blocking ports) before it assumes the Root bridge or the link is dead. Giving that timer, why does every bridge must know the Hello timer as well? How do…

Networking pup
- 65
- 1
- 7