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
0 answers
Spanning Tree that Preserves the Number of Branch Vertices
Suppose a undirected connected graph $G$, denote the number of vertices in $G$ as $n$, number of branch vertices (i.e., vertices with degree $\geq 3$) as $n_{\geq 3}$. Suppose $n_{\geq 3}>\log(n)$.
My question is: Is there always a spanning tree $T$…

Mingzhou Liu
- 111
- 3
0
votes
1 answer
is it possible to find a spanning tree for a direct and unweighted graph?
I try to explain my problem better.
in input I have the number of nodes N and the number of edges P.
N represent the cities while P the water pipes.
So for example in input I have 4 and 2 {0,1,2,3,4} would be my graph
and the 2 represents me the…

mimmolg99
- 17
- 7
0
votes
0 answers
Is the computed number of spanning trees for this undirected graph reasonable/correct?
This is part of my Master thesis which is about designing hydrogen pipeline networks.
For a particular graph of 135 nodes and 157 edges and (see figure below), I need to compute the number of spanning trees (spanning all nodes).
I used the…

Khalilbs
- 71
- 1
- 3
0
votes
2 answers
How is a cut lonely if there are often multiple edges crossing a cut in a connected undirected graph?
I'm learning the requirements for finding a minimum spanning tree for a connected, undirected graph with distinct edge costs. One of the requirements is that there must be no cycles created in the tree, and the reason given for why a cycle isn't…

julieb
- 43
- 1
- 5
0
votes
0 answers
Time Complexity of (Minimum Spanning Tree) Prim's Algorithm
When we implement this algorithm using adjacency matrix and without using priority queue, the time complexity comes out to be O(V^2), where V is the total no. of vertices and E is the total no. of edges.
But when we implement it using priority…

Dhrxv
- 33
- 5
0
votes
0 answers
Edmond maximum branching algorithm
I am trying to have an implementation on Python for Edmond's maximum branching algorithm.
Maximum Branching Problem. Given a directed graph G=(V,E, w) where w be the weight function. For a root r in V, determine a branching G'=(V,E') rooted r, i.e.…

The Nguyen
- 109
- 1
0
votes
1 answer
Ne04j Graph Nodes, Expand a spanning tree but stop at specific node (but don't stop for other nodes)
I have the following setup
Person is part of an organisation
Person attends meeting
Meeting is held in a location
More than one person can attend a meeting
More than one person can be part of same organisation
Persons from different organisation…

Bertrand Leroy
- 145
- 9
0
votes
1 answer
How to find a spanning tree of a undirected graph(not necessary MST)?
I know the brute force approach for solving this problem which can be given as:
Iterate over all edges
Take a set(or list)(suppose s)
if adding an edge to s doesn't make a cycle then add edge to s
End if iteration is complete over all edges.
But I…

Abhishek Jaiswal
- 288
- 2
- 14
0
votes
0 answers
Minimum spanning trees of sub-graphs?
Any hint please if I should prove or search for counterexample, at least to know which direction to go...
Consider the following 2 graphs:
G1 (V, E1)
G2 (V, E2)
and a weight function for the vertices w: (E1 \untion E2) -> R
and 2 minimum spanning…
user15862679
0
votes
0 answers
Counting spanning trees in a graph
I have a problem. I am trying to count all the spanning trees in a graph(it doesn't have multi edges). I know that there is Kirchhoff's theorem, which lets me count it in quite an easy way, but I prefer a solution which uses cycles in this graph.
I…

manez
- 1
0
votes
2 answers
Give me an example of why IP tries to route on a spanning tree
I've been watching a talk given by Van Jacobson in which he casually claims that IP tries to route on a spanning tree, as not doing so results in loops which can quickly bring down a network. He then goes on to say that one of the disadvantages…

Bryce Thomas
- 10,479
- 26
- 77
- 126
0
votes
1 answer
Maximum spanning tree using Prim's algorithm
How would this algorithm be changed to give a maximum spanning tree?
MST_prim(G,w,r)
for each u that exists in G.V
u.key= inf
u.pi=NIL
r.key=0
Q=G.V
While Q is not empty
u= EXTRACT-MIN(Q)
for each v in G.Adj[u]
if v is in Q and…

Mia Sheikh
- 21
- 3
0
votes
1 answer
Configure STP protocol via scapy
I need to generate and STP traffic using scapy and when I visualize it via wireshark I get an output similar to the caption shown below:
when I run this code:
from scapy.all import STP
import scapy
from scapy.all import…

newbie
- 646
- 8
- 27
0
votes
1 answer
Given an unweighted graph how do I find a spanning tree with 1. Maximum number of leaves 2 minimum number of leaves
write an algorithm to find a spanning tree that has the maximum number of leaves.
Write an algorithm to find a spanning tree with minimum number of nodes.
I am yet not able to come up with a solution for the following questions.
For the first…

Prateek Agrawal
- 73
- 1
- 6
0
votes
1 answer
Show that there exists a minimum spanning tree from a vertex always containing the shortest edge from that vertex
Suppose that e is an edge in a weighted graph that is incident to a vertex v such that the weight of e does not exceed the weight of any other edge incident to v. Show that there exists a minimum spanning tree containing this edge.