minimum-spanning-tree

Network X , which depth searching option to select for this use?

China☆狼群 提交于 2019-12-07 18:58:31
I am trying to ensure a global correct orientation of my normals. I.e make sure they point outwards everywhere. This is my method: I have a coordinate list x y c n . At each point in coordinate list I create edges from the point to its 5 nearest neighbours. I Weight each edge with ( 1-n1.n2 ). Compute a minimal spanning tree. Traverse this tree in depth first order. Start traversing at the point with the greatest z value, force the normal of this point to be orientated towards the positive z axis. Assign orientation to subsequent points that are consistent with their preceeding point, for

Graph Has Two / Three Different Minimal Spanning Trees ?

╄→尐↘猪︶ㄣ 提交于 2019-12-07 01:54:03
问题 I'm trying to find an efficient method of detecting whether a given graph G has two different minimal spanning trees. I'm also trying to find a method to check whether it has 3 different minimal spanning trees. The naive solution that I've though about is running Kruskal's algorithm once and finding the total weight of the minimal spanning tree. Later , removing an edge from the graph and running Kruskal's algorithm again and checking if the weight of the new tree is the weight of the

Finding a Minimum Spanning Tree given the old MST and a new vertex + edges

天涯浪子 提交于 2019-12-06 11:38:18
问题 In a sample problem, I'm given a MST T for a weighted graph G = (V, E). The question is, if a new vertex v and all its edges are to be added to the graph, what is an o(|V|log|V|) algorithm to compute the new MST of this new G* = (V U v, E*). My only idea so far is: add min( out(v) ) to T for each edge e in out(v) do let u be the other vertex of e if there exists a lower weight path from v to u then remove all edges in that path from T add e to T Two problems: What do I do with the vertices

Find minimum-weight complete graph that spans a given minimum spanning tree

こ雲淡風輕ζ 提交于 2019-12-06 08:06:08
问题 Let T = (V, E) be a tree of |V| vertices and |E| = |V-1| edges, with known costs. We want to construct a minimum-weight complete Graph G = (V, E') that spans T as its unique minimum spanning tree. Example: consider the following tree T . Edges in red have a given cost. Dotted edges will be added to construct a complete graph from this tree. The minimum-weight complete graph G that spans T as its unique MST is the following: I am trying to find a (polynomial-time) algorithm that generates this

Algorithm to find minimum spanning tree of chosen vertices

◇◆丶佛笑我妖孽 提交于 2019-12-06 01:06:02
问题 One can use Prim's algorithm or Kruskal's algorithm to find the minimum spanning tree/graph of a collection of vertices/nodes and edges/links. What I want though, is an algorithm that finds the minimum spanning graph of this collection, but the resulting graph needs to include only arbitrarily chosen nodes, instead of all nodes. It's okay if the resulting graph includes more nodes than just those needed. Does such an algorithm exist? Perhaps one could just use Prim's (or Kruskal's) algorithm

Algorithm for finding a spanning tree with weights of 1 and 2 only

断了今生、忘了曾经 提交于 2019-12-04 18:05:19
Given a weighted, connected, simple undirected graph G with weights of only 1 and 2 on each edge, find the MST of G in O(V+E). Any ideas? Sorry for the phrasing of the question, I tried translating it as best as I could. In Prim's algorithm you need a way of storing active edges such that you can access and delete the edge with lowest weight. Normally there are a wide range of weights and some kind of heap data structure is used to store the edges. However, in this case, the weights are either 1 or 2, and so you can simply store the edges in 2 separate lists, one for edges with weight 1, and

How to update MST after deleting an edge from the graph?

為{幸葍}努か 提交于 2019-12-04 16:03:21
I have a graph represented with adjacency lists and his MST represented by parent array. My problem is that I need to delete an edge from the graph and update parent array. I've already manage to do the cases when: the edge doesn't exist; the edge is in graph but not in MST (MST doesn't change); and the edge is the only path from two nodes(in this case I return null, because the graph is not connected). What can I do when the edge is in MST and the edge in graph is in a cycle? I need to do this in O(n+m) complexity . I write the costs of edges with red color. Just search the minimum-distance

Can two Minimum Spanning Trees for the same graph have different edge weights?

核能气质少年 提交于 2019-12-04 12:37:40
A graph can have many different Minimum Spanning Trees (MSTs), but can different MSTs have different sets of edge weights? For example, if an MST uses edge weights {2,3,4,5}, must every other MST have edge weights {2,3,4,5}, or can some other MST use a different collection of weights? What gave me the idea is property that a graph has no unique MST only if its edge weights are different. The sets must have the same weight. Here's a simple proof: suppose they don't. Let's let T1 and T2 be MSTs for some graph G with different multisets of edge weights. Sort those edges into ascending order of

Determine if a given weighted graph has unique MST

空扰寡人 提交于 2019-12-04 10:56:44
问题 I'm looking for an algorithm (or any other way) to determine if a given weighted graph has unique MST (Minimum spanning tree) in O(ElogV)? I don't know anything about the weights (e.g. weight(e1) != weight(e2)), and the algorithm just return True if this graph has only one unique MST or False if not. I started by using Kruskal's algo, and check if find-set(u)==find-set(v) so there is a circle in the MST, but this way does not cover all the scenarios as I thought :( Thanks a lot! Tomer. 回答1:

Create a MST with depth-first search?

青春壹個敷衍的年華 提交于 2019-12-04 05:54:29
问题 I have a symmetrical graph and created a tree with all shortest path from a random vertex to any other vertex. Can I use the tree to construct a Minimum Spanning Tree(MST)? My algorithm is similar to depth-first algorithm. 回答1: In the worst case, a shortest path tree does not help in finding a minimum spanning tree. Consider a graph where we want to find the MST. Add a source vertex with edges of an identical large length to each other vertex. The shortest path tree from that source consists