I am writing an algorithm to find the dominating set of a tournament graph. Is the minimum spanning tree of a directed graph equivalent to the dominating set of the graph? In other words, if I find the smallest MST for the tournament graph (by iterating through all of the vertices), can I then say this is equivalent to the dominating set...
I have reduced my problem to finding the minimal spanning tree in the graph. But I want to have one more constraint which is that the total degree for each vertex shouldnt exceed a certain constant factor. How do I model my problem? Is MST the wrong path? Do you know any algorithms that will help me?
One more problem: My graph has dup...
I was wondering when one should use Prim's algorithm and when Kruskal's to find the minimum spanning tree? They both have easy logics, same worst cases, and only difference is implementation which might involve a bit different data structures. So what is the deciding factor?
...
I've implemented Prim's algorithm in C (www.bubblellicious.es/prim.tar.gz) but I was just wondering how to transform this into Kruskal's algorithm.
It seems they're quite similar, but I can't imagine how can I modify my old code into that new one. It'd be delicious if you give some advices or something. I know that's easy, but I'm still...
I have two sets of Animal objects. The distance between animals is defined using a specific algorithm that looks at their traits. I am trying to design a method to find the pair from the two sets (one from each) that minimizes the distance.
One idea I had: create a parametrized Tuple class to pair up Animals. Create a PriorityQueue with...
I have written a code that solves MST using Prim method. I read that this kind of implementation(using priority queue) should have O(E + VlogV) = O(VlogV) where E is the number of edges and V number of Edges but when I look at my code it simply doesn't look that way.I would appreciate it if someone could clear this up for me.
To me it s...
I have a problem that can essentially be viewed as a graph. I'm considering using JGraphT to implement it instead of rolling my own. What would be the best way to get a minimum spanning tree out of a graph using JGraphT?
...
JGraphT has a nice Fibonacci Heap class. How can I use it to implement Prim's minimum spanning tree algorithm?
...
I am trying to implement Prim's minimum spanning tree algorithm with JGraphT. How does it look?
One issue I ran into was JGraphT's handling of everything like it's directed. So sometimes it is necessary to make some awkward calls to reverse g.getEdgeSource(e) and g.getEdgeTarget(e) if they didn't happen to be right.
I tried to implemen...
I intuitively feel that if one is using Prim's algorithm to find a graph's minimum spanning tree, it doesn't matter which root node is picked - the resultant MST will have the same weight regardless. Is this correct?
...
Dijkstra's is typically used to find the shortest distance between two nodes in a graph. Can it be used to find a minimum spanning tree? If so, how?
Edit: This isn't homework, but I am trying to understand a question on an old practice exam.
...
I've been studying from the Cormen et al book and I'm a bit confused regarding the algorithm they have provided. I've understood how the concept of Prim's algo works through wikipedia, but I can't mimic that working using the algorithm provided in my book.
Refer to this online copy of the chapter:
http://www.cs.cmu.edu/afs/cs/academic/c...
If we have an (arbitrary) connected undirected graph G, whose edges have distinct weights,
does every MST of G contains the minimum weighted edge?
is there an MST of G that does not contain the maximum weighted edge?
Also, I'm more thankful if someone can give a hint of the key things one must keep in mind when dealing with such MST ...
I've been presented the following problem in University:
Let G = (V, E) be an (undirected) graph with costs ce >= 0 on the edges e E. Assume you are given a minimum-cost spanning tree T in G. Now assume that a new edge is added to G, connecting two nodes v, tv V with cost c.
Give an efficient algorithm to test if T remains the minim...
Given a directed graph with weighted edges, what algorithm can be used to give a sub-graph that has minimum weight, but allows movement from any vertex to any other vertex in the graph (under the assumption that paths between any two vertices always exist).
Does such an algorithm exist?
...
I've been looking for an implementation (I'm using networkx library.) that will find all the minimum spanning trees (MST) of an undirected weighted graph.
I can only find implementations for Kruskal's Algorithm and Prim's Algorithm both of which will only return a single MST.
I've seen papers that address this problem (such as Represen...
My teacher asked us to implement a Dynamic Programming solution to that problem, but I'm thinking one doesn't exist since I couldn't find it using Google.
Anyway, given a graph and a k, say 3, you have to find the 3 best MSTs from it. If the graph is such that it doesn't have k subtrees, you can return either the same tree multiple time...
Hi,
I've been spending a lot of time reading online presentations and textbooks about the cut property of a minimum spanning tree. I don't really get what it's suppose to illustrate or even why it's practical. Supposedly it helps determine what edges to add to a MST, but I fail to see how it accomplishes that. My understanding of the cu...
Suppose I have 3 kinds of restrictions to computing a spanning tree:
Constrained degree (eg: a node in
a spanning tree may only be
connected up to 3 other nodes)
Bounded diameter (eg: all edges'
weights, once summed, cannot exceed
100).
2.1. If possible, show all subtrees that meet this criteria.
Both
Are there any good algorithms t...
1 Begin with a connected graph G containing edges of distinct weights, and an empty set of edges T
2 While the vertices of G connected by T are disjoint:
3 Begin with an empty set of edges E
4 For each component:
5 Begin with an empty set of edges S
6 For each vertex in the component:
7 Add the cheapest edge from...