answersLogoWhite

0


Best Answer

It's an algorithm to find the spanning tree in decision maths. The method is:

  1. list weights in ascending order from smallest weight to largest weight.
  2. then starting form the beginning of your list, tick the weights you want to use and cross out the ones which make a cycle. do this till you've reached all the nods then cross out the rest.
  3. add up the weights you used to give you the total weight of the spanning tree.
User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Algorithm for spanning tree using krushkal?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is krushkal algorithm?

Kruskal's algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized. If the graph is not connected, then it finds a minimum spanning forest (a minimum spanning tree for each connected component). Kruskal's algorithm is an example of a greedy algorithm.


Can dijkstra's algorithm produce a spanning tree?

yes, but a shortest path tree, not a minimum spanning tree


What is the runtime complexity of Prim's algorithm for finding the minimum spanning tree of a graph?

The runtime complexity of Prim's algorithm for finding the minimum spanning tree of a graph is O(V2) using an adjacency matrix or O(E log V) using a binary heap.


How can you find minimum spanning trees?

Minimum spanning trees can be found using algorithms like Prim's algorithm or Kruskal's algorithm. These algorithms work by starting with an empty spanning tree and iteratively adding edges with the smallest weights until all vertices are connected. The resulting tree will have the minimum total weight possible.


What is the runtime of Prim's algorithm for finding the minimum spanning tree of a graph?

The runtime of Prim's algorithm for finding the minimum spanning tree of a graph is O(V2) with a simple implementation, or O(E log V) with a more efficient implementation using a priority queue.


Is determining the minimum spanning tree of a graph an NP-complete problem?

Determining the minimum spanning tree of a graph is not an NP-complete problem. It can be solved in polynomial time using algorithms like Prim's or Kruskal's algorithm.


Can you provide the pseudocode for Kruskal's algorithm?

Here is the pseudocode for Kruskal's algorithm: Sort all the edges in non-decreasing order of their weights. Initialize an empty minimum spanning tree. Iterate through all the edges in sorted order: a. If adding the current edge does not create a cycle in the minimum spanning tree, add it to the tree. Repeat step 3 until all vertices are included in the minimum spanning tree. This algorithm helps find the minimum spanning tree of a connected, undirected graph.


Why will the shortest paths tree returned by Dijkstra's algorithm never be a correct minimum spanning tree (MST)?

The shortest paths tree returned by Dijkstra's algorithm will never be a correct minimum spanning tree (MST) because Dijkstra's algorithm prioritizes finding the shortest path from a single source node to all other nodes, while a minimum spanning tree aims to connect all nodes in a graph with the minimum total edge weight without forming cycles. Dijkstra's algorithm does not consider the overall connectivity of the graph, leading to potential inconsistencies with the requirements of a minimum spanning tree.


Can someone provide the C program for Prim's algorithm?

The C code for Prim's algorithm can be found in the following link. https://sites.google.com/site/itstudentjunction/lab-programming-solutions/data-structures-programs/program-to-find-minimal-spanning-tree-using--prims-algorithm


What is the pseudocode for implementing the Kruskal algorithm to find the minimum spanning tree of a graph?

The pseudocode for implementing the Kruskal algorithm to find the minimum spanning tree of a graph involves sorting the edges by weight, then iterating through the sorted edges and adding them to the tree if they do not create a cycle. This process continues until all vertices are connected.


What is the complexity of kruskal's minimum spanning tree algorithm on a graph with n nodes and e edges?

o(eloge)


How do you use prim's algorithm to find a spanning tree of a connected graph with no weight on its edges?

Prims Algorithm is used when the given graph is dense , whereas Kruskals is used when the given is sparse,we consider this because of their time complexities even though both of them perform the same function of finding minimum spanning tree. ismailahmed syed