When can Prim’s and Kruskal’s algorithms yield different MSTs?
if a graph have more than one MST then Prim's and Kruskal's algorithms might yield different MST's.
But most of the times Prim's and Kruskal's algorithms yield same MST's. because both are greedy algorithms.
JAVA: (29.1) The text introduced Prim’s algorithm for finding a minimum spanning tree. Kruskal’s algorithm is another well-known algorithm for finding a minimum spanning tree. The algorithm repeatedly finds a minimum- weight edge and adds it to the tree if it does not cause a cycle. The process ends when all vertices are in the tree. Design and implement an algorithm for finding an MST using Kruskal’s algorithm.
You are given an undirected graph G = (V, E) with positive weights on the edges. If the edge weights are distinct, then there is only one MST, so both Prim’s and Kruskal’s algorithms will find the same MST. If some of the edge weights are the same, then there can be several MSTs and the two algorithms could find different MSTs. Describe a method that forces Prim’s algorithm to find the same MST of G that Kruskal’s algorithm finds.
When running Kruskal’s to find MST, we use DisjointSet to detect cycles in a graph. We know that DFS or BFS can also detect cycles in a graph. Can we instead choose DFS or BFS over DisjointSet in Kruskal’s? Briefly explain the reason.
Where we can plugin monitor algorithms and when monitor algorithms are invoked in Application framework?
Implement the above simulation for the 3 scheduling algorithms, FIFO, SJF, SRT.Assume a value for k, which is the time interval during which processes may arrive. Ex: k = 1000.Using a random number generator, derive n arrival times, Aᵢ, for all processes, distributed uniformly within the interval [0 : k].Choose an average total CPU time, d, and a standard deviation, v, and derive n total CPU times, Tᵢ, using a normal (Gaussian) distribution.Repeat the simulation for different values of d...
Different clustering algorithms behave different on the same dataset. Single Link and Complete Link are two agglomerative clustering algorithms. Find a data file D such that these two algorithms behave differently on D, and display their behavior. (A set of 6 to 10 points probably works well.)
Can you please briefly describe when to use each algorithm? Supervised algorithms (Machine learning): - k-Nearest Neighbours - Support Vector Machines (SVM) Unsupervised algorithms (Machine learning) : - K-means clustering - Cross-Validation
When are algorithms like DES or 3DES appropriate?
implement a program, which allow you to evaluate and compare different scheduling algorithms. List of implemented algorithms for evaluation should include FCFS algorithm and at least one from the following: -SJF – preemptive and non-preemptive -Priority scheduling – preemptive and non-preemptive -RR -Multilevel feedback queue Your program should be able to work in two different modes: “Single algorithm performance evaluation” and “Algorithm comparing”
Problem: An article in Communications of the ACM (Vol. 30, No. 5, 1987) studied different algorithms for estimating software development costs. Six algorithms were applied to several different software development projects and the percent error in estimating the development cost was observed. Some of the data from this experiment is shown in the table below. We are interested to find if different algorithms are different in their mean cost estimation accuracy or not? Project Algorithm 1 2 3 4...