minimum-spanning-tree

Euclidean Minimum Spanning Tree Without Triangulation

爱⌒轻易说出口 提交于 2019-12-04 05:51:20
问题 I was looking through some text about finding the EMST (Euclidean MST) using Delaunay triangulation technique, but also read somewhere that the EMST can be found through a sweep line algorithm. Since this would easier implementing, I would like to implement this rather than using a existing library. Can anyone guide me/ direct me to a link to a (possibly free) paper/source that has this algorithm explained? 回答1: From this and going by the abstracts, this and this should get you started. They

Will a minimum spanning tree and shortest path tree always share at least one edge?

自作多情 提交于 2019-12-03 17:41:44
问题 I'm studying graph theory and I have a question about the connection between minimum spanning trees and shortest path trees. Let G be an undirected, connected graph where all edges are weighted with different costs . Let T be an MST of G and let T s be a shortest-path tree for some node s . Are T and T s guaranteed to share at least one edge? I believe this is not always true, but I can't find a counterexample. Does anyone have a suggestion on how to find a counterexample? 回答1: I think that

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

為{幸葍}努か 提交于 2019-12-03 13:08:08
问题 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 trees and increment the running counter when it is equal to the weight of minimum spanning tree. I couldn't find any method to find the weights of all the spanning trees and also the number of spanning trees might be very large, so this method might

Faster second-best MST algorithm?

一笑奈何 提交于 2019-12-03 13:06:03
I am struggling with this. We can get MST using Kruskal's algorithm or Prim's algorithm for the MST. And for "second-best" MST, I can: first get MST using either of the algorithm mentioned above. For each V-1 of the optimal edge from the MST: a. first remove or flag the edge b. continue calculating MST without that edge c. compare and record down that "second-best" MST with previous iteration In the end we have "second-best" MST But this runs in O(VE) where V is num of vertex and E is number of edges. How can get a speed up using Union-find disjoint set or LCA(lowest common ancester) ? hints,

How to compute a minimum bottleneck spanning tree in linear time?

こ雲淡風輕ζ 提交于 2019-12-03 08:51:30
问题 We can find a minimum bottleneck spanning tree in O(E log*V) in the worst case by using Kruskal's algorithm. This is because every minimum spanning tree is a minimum bottleneck spanning tree. But I got stuck on this job-interview question from this course. How can we find a minimum bottleneck spanning tree in linear time even in the worst case. Note that we can assume that we can compute the median of n keys in linear time in the worst case. 回答1: Get V , the median of the weights of the |E|

Will a minimum spanning tree and shortest path tree always share at least one edge?

强颜欢笑 提交于 2019-12-03 06:41:50
I'm studying graph theory and I have a question about the connection between minimum spanning trees and shortest path trees. Let G be an undirected, connected graph where all edges are weighted with different costs . Let T be an MST of G and let T s be a shortest-path tree for some node s . Are T and T s guaranteed to share at least one edge? I believe this is not always true, but I can't find a counterexample. Does anyone have a suggestion on how to find a counterexample? I think that this statement is actually true , so I doubt you can find a counterexample. Here's a hint - take any node in

An algorithm to see if there are exactly two MSTs in a graph?

岁酱吖の 提交于 2019-12-03 05:06:59
问题 I have an undirected connected graph G. I wish to find an algorithm that return true if there are at least 2 MSTs. What if I want to see if there are exactly 2 MSTs? 回答1: We can detect both cases efficiently by modifying the Kruskal algorithm. If someone can think of a simpler way to describe all this, please let me know! Kruskal builds an MST for every permutation of equal-weight edges The Kruskal algorithm builds an MST by always including the next-smallest edge that connects different

Check if edge is included in SOME MST in linear time (non-distinct values)

∥☆過路亽.° 提交于 2019-12-03 05:06:32
问题 I am working on an algorithm to check if a given edge is included in one of all possible mst's. For this question, we are considering non-distinct values and our edge e connects vertices A & B. So far, I have: If a path can be made from A to B consisting of edges with weights less than or equal to the weight of our edge e--we can say that edge e is not a part of any MST. Am I missing anything here/ ideas on a better algorithm? EDIT: What are thoughts on a solution involving the cycle property

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

邮差的信 提交于 2019-12-03 04:14:54
问题 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 statements make sense. 回答1: Look at the MST example on Wikipedia for reference: A bottleneck in a spanning tree is a maximum-weight edge in that tree. There may be several bottlenecks (all of the same weight of course) in a spanning tree. In the

Implementing a randomly generated maze using Prim's Algorithm

余生颓废 提交于 2019-12-03 02:52:51
I am trying to implement a randomly generated maze using Prim's algorithm. I want my maze to look like this: however the mazes that I am generating from my program look like this: I'm currently stuck on correctly implementing the steps highlighted in bold: Start with a grid full of walls. Pick a cell, mark it as part of the maze. Add the walls of the cell to the wall list. While there are walls in the list: **1. Pick a random wall from the list. If the cell on the opposite side isn't in the maze yet: Make the wall a passage and mark the cell on the opposite side as part of the maze.** Add the