spanning-tree

Algorithm for minimum diameter spanning tree

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 00:04:21
问题 Given a undirected and connected graph G, find a spanning tree whose diameter is the minimum. 回答1: singhsumit linked the relevant paper by Hassin and Tamir, entitled "On the minimum diameter spanning tree problem", but his answer is currently deleted. The main idea from the paper is that finding a minimum diameter spanning tree in an undirected graph can be accomplished by finding the "absolute 1-center" of the graph and returning a shortest path tree rooted there. The absolute 1-center is

Algorithm for minimum diameter spanning tree

早过忘川 提交于 2019-12-01 20:38:17
Given a undirected and connected graph G, find a spanning tree whose diameter is the minimum. singhsumit linked the relevant paper by Hassin and Tamir , entitled "On the minimum diameter spanning tree problem", but his answer is currently deleted. The main idea from the paper is that finding a minimum diameter spanning tree in an undirected graph can be accomplished by finding the "absolute 1-center" of the graph and returning a shortest path tree rooted there. The absolute 1-center is the point, either on a vertex or an edge, from which the distance to the furthest vertex is minimum. This can

spanning tree with exactly k colored edges

雨燕双飞 提交于 2019-12-01 08:35:12
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 actual tree). I used Kruskal's algorithm to find the minimum and maximum possible number of black edges in a spanning tree. If k is outside this range, no spanning tree with k edges can exist. But I'm having trouble wrapping my mind around whether there is necessarily a spanning tree for every k within that range. My intuition says yes, and it's