Applications of Kruskal and Prim's algorithms - algorithm

Could anyone please give some applications of the two algorithms,
where and which applications they can be used for?

Minimum spanning trees were first studied for ways to lay out electrical networks in a way that minimizes the total cost of the wiring. In a minimum spanning tree, all the nodes (houses) would be connected to power by wires in a way that has minimum cost and redundancy (cutting any wire necessarily cuts the power grid into two pieces).
Since then, the problem has been well-studied and is often used as a subroutine in more complex algorithms. The Christofides algorithm for finding approximate solutions to the Traveling Salesman Problem uses it in a key step, as do some algorithms for finding Steiner trees.
Minimum spanning trees have also been used to generate mazes. Both Kruskal's and Prim's algorithm have been used this way, often creating high-quality mazes.
If you're interested in a full history of the minimum spanning tree problem, its applications, and its algorithms, there is a truly excellent paper available here that covers all of these. I'd strongly suggest giving it a read!
Hope this helps!

Quoting Wikipedia:
One example would be a cable TV company laying cable to a new neighborhood. If it is constrained to bury the cable only along certain paths, then there would be a graph representing which points are connected by those paths. Some of those paths might be more expensive, because they are longer, or require the cable to be buried deeper; these paths would be represented by edges with larger weights. A spanning tree for that graph would be a subset of those paths that has no cycles but still connects to every house. There might be several spanning trees possible. A minimum spanning tree would be one with the lowest total cost.
Source: http://en.wikipedia.org/wiki/Minimum_spanning_tree

First you must understand that both Prim's and Kruskal's algorithm are useful for finding Minimum spanning Tree in a Graph. One of the pratical applications of minimal spanning tree, I can think of is connecting different offices of the same company with least cost.

Both Prims And Kruskal Algorithms are used to find the minimum spanning trees.
Now the applications of Kruskal and Prims Algorithm are basically the applications of MST. So what are the applications of MST?
Well, to answer a few, here are some of the areas in which you will find them usable:
If you want to connect several cities using highways or rail networks, you can use these algos to find the minimum length of roads/railtracks connecting all these cities.
Network Design - Suppose you have a business with several offices. You have to lease phone cables to connect all these offices. So you can make use of these algos to find out what is the minimum cost to connect all your offices with minimum use of phone cables.
Can be used to find the travelling salesman problem. This is a very famous problem using MST.
You want to apply a set of houses with - Electric Power, Telephone Lines, Sewage Lines.
Designing Local Area Networks.

Topology
Cartography
Geometry
Clustering
Routing Algorithms
Generation of Mazes
Mechanical / Electrical / Computer Networks
Study of Molecular bonds in Chemistry

Applications of Kruskal and Prim's algorithms often come up in computer networking. For example, if you have a large LAN with many switches, finding a minimum spanning tree will be vital to ensure that only a minimum number of packets will be transmitted across the network.

Related

Real world applications where spanning tree data structure is used

Does anyone of you know any real world applications where spanning tree data structure is used?
In networking, we use Minimum spanning tree algorithm often. So the problem is as stated here, given a graph with weighted edges, find a tree of edges with the minimum total weight that satisfies these three properties: connected, acyclic, and consisting of |V| - 1 edges. (In fact, any two of the three conditions imply the third condition.)
as an example,
For instance, if you have a large local area network with a lot of
switches, it might be useful to find a minimum spanning tree so that
only the minimum number of packets need to be relayed across the
network and multiple copies of the same packet don't arrive via
different paths (remember, any two nodes are connected via only a
single path in a spanning tree).
Other real-world problems include laying out electrical grids,
reportedly the original motivation for Boruvka's algorithm, one of the
first algorithms for finding minimum spanning trees. It shouldn't be
surprising that it would be better to find a minimum spanning tree
than just any old spanning tree; if one spanning tree on a network
would involve taking the most congested, slowest path, it's probably
not going to be ideal!
There are many other applications apart from the computer networks, i listed the references below:
Network design:
– telephone, electrical, hydraulic, TV cable, computer, road
The standard application is to a problem like phone network design. You have a business with several offices; you want to lease phone lines to connect them up with each other; and the phone company charges different amounts of money to connect different pairs of cities. You want a set of lines that connects all your offices with a minimum total cost. It should be a spanning tree, since if a network isn’t a tree you can always remove some edges and save money.
Approximation algorithms for NP-hard problems:
– traveling salesperson problem, Steiner tree
A less obvious application is that the minimum spanning tree can be used to approximately solve the traveling salesman problem. A convenient formal way of defining this problem is to find the shortest path that visits each point at least once.
Note that if you have a path visiting all points exactly once, it’s a special kind of tree. For instance in the example above, twelve of sixteen spanning trees are actually paths. If you have a path visiting some vertices more than once, you can always drop some edges to get a tree. So in general the MST weight is less than the TSP weight, because it’s a minimization over a strictly larger set.
On the other hand, if you draw a path tracing around the minimum spanning tree, you trace each edge twice and visit all points, so the TSP weight is less than twice the MST weight. Therefore this tour is within a factor of two of optimal.
Indirect applications:
– max bottleneck paths
– LDPC codes for error correction
– image registration with Renyi entropy
– learning salient features for real-time face verification
– reducing data storage in sequencing amino acids in a protein
– model locality of particle interactions in turbulent fluid flows
– autoconfig protocol for Ethernet bridging to avoid cycles in a network
Cluster analysis:
k clustering problem can be viewed as finding an MST and deleting the k-1 most
expensive edges.
you can read the details from here, and here, and for a demo check here please.

Algorithms: Esau-Williams algorithm

I would like to ask are there any sittuations that Esau-Williams algorithm may be useful? I know that it is used to solve CMST problem, but I can't find any sittuation that CMST problem may appear.
According to Wikipedia, "CMST problem is important in network design: when many terminal computers have to be connected to the central hub, the star configuration is usually not the minimum cost design. Finding a CMST that organizes the terminals into subnetworks can lower the cost of implementing a network."
As the name suggests, CMST stands for Capacitated Minimum Spanning Tree where each nodes have limited capacity to connect to other nodes. This makes a node to connect to limited number of other nodes depending on the node's capacity.
Typically in any practical applications, a minimum spanning tree is not the only objective. There can be a lot of other constraints as well, for instance, in a network design the maximum amount of data that the output port of router(node) can handle is one capacity constraint. This marks the importance on heuristic algorithms like Esau-Williams CMST algorithm, Modified Kruskal CMST Algorithm etc..
Like networking any field which uses graphs, for example logistics, based on their constraints can use heuristic algorithms like Esau-William
CMST can be utilised in cases such as deciding the cable layout for offshore wind turbines where each turbine has to be connected to a point in euclidean space called sub station. We cant use minimum spanning tree because it has capacity limitation on the number of turbines that can be connected on a single cable.

Significance of various graph types

There are a lot of named graph types. I am wondering what is the criteria behind this categorization. Are different types applicable in different context? Moreover, can a business application (from design and programming perspective) benefit anything out of these categorizations? Is this analogous to design patterns?
We've given names to common families of graphs for several reasons:
Certain families of graphs have nice, simple properties. For example, trees have numerous useful properties (there's exactly one path between any pair of nodes, they're maximally acyclic, they're minimally connected, etc.) that don't hold of arbitrary graphs. Directed acyclic graphs can be topologically sorted, which normal graphs cannot. If you can model a problem in terms of one of these types of graphs, you can use specialized algorithms on them to extract properties that can't necessarily be obtained from an arbitrary graph.
Certain algorithms run faster on certain types of graphs. Many NP-hard problems on graphs, which as of now don't have any polynomial-time algorithms, can be solved very easily on certain types of graphs. For example, the maximum independent set problem (choose the largest collection of nodes where no two nodes are connected by an edge) is NP-hard, but can be solved in polynomial time for trees and bipartite graphs. The 4-coloring problem (determine whether the nodes of a graph can be colored one of four different colors without assigning the same color to adjacent nodes) is NP-hard in general, but is immediately true for planar graphs (this is the famous four-color theorem).
Certain algorithms are easier on certain types of graphs. A matching in a graph is a collection of edges in the graph where no two edges share an endpoint. Maximum matchings can be used to represent ways of pairing people up into groups. In a bipartite graph, a maximum matching can be used to represent a way of assigning people to tasks such that no person is assigned two tasks and no task is assigned to two people. There are many fast algorithms for finding maximum matchings in bipartite graphs that work quickly and are easy to understand. The corresponding algorithms for general graphs are significantly more complicated and slightly less efficient.
Certain graphs are historically significant. Many named graphs are named after someone who used the graph to disprove a conjecture about properties of arbitrary graphs. The Petersen graph, for example, is a counterexample to many theorems that seem true about graphs but are actually not.
Certain graphs are useful in theoretical computer science. An expander graph is a graph where, intuitively, any collection of nodes must be connected to a proportionally larger collection of nodes in the graph. Not all graphs are expander graphs. Expander graphs are used in many results in theoretical computer science, such as one proof of the PCP theorem and in the proof that SL = L.
This is not an exhaustive list of why we care about different graph families, but hopefully it helps motivate their usage and study.
Hope this helps!

computing vertex connectivity of graph

Is there an algorithm that, when given a graph, computes the vertex connectivity of that graph (the minimum number of vertices to remove in order to separate the graph into two connected graphs). (Note that the graph may be already be disconnected). Thanks!
See:
Determining if a graph is K-vertex-connected
k-vertex connectivity of a graph
When you combine this with binary search you are done.
This book chapter should have everything you need to get started; it is basically a survey over algorithms to determine the edge connectivity and vertex connectivity of graphs, with pseudo code for the algorithms described in it. Page 12 has an overview over the available algorithms alongside complexity analyses and references. Most of the solutions for the general case are flow-based, with the exception of one randomized algorithm. The different general solutions optimize for different properties of the graph, so you can choose the most asymptotically efficient one beforehand. Also, for some classes of graphs, there exist specialized algorithms with better complexity than the general solutions provide.

Names of Graph Traversal Algorithms

What I'm looking for is a comprehensive list of graph traversal algorithms, with brief descriptions of their purpose, as a jump off point for researching them. So far I'm aware of:
Dijkstra's - single-source shortest path
Kruskal's - finds a minimum spanning tree
What are some other well-known ones? Please provide a brief description of each algorithm to each of your answers.
the well knowns are :
Depth-first search http://en.wikipedia.org/wiki/Depth-first_search
Breadth-first search http://en.wikipedia.org/wiki/Breadth-first_search
Prim's algorithm http://en.wikipedia.org/wiki/Prim's_algorithm
Kruskal's algorithm http://en.wikipedia.org/wiki/Kruskal's_algorithm
Bellman–Ford algorithm http://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm
Floyd–Warshall algorithm http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
Reverse-delete algorithm http://en.wikipedia.org/wiki/Reverse-Delete_algorithm
Dijkstra's_algorithm http://en.wikipedia.org/wiki/Dijkstra's_algorithm
network flow
Ford–Fulkerson algorithm http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm
Maximum Flow http://en.wikipedia.org/wiki/Maximum_flow_problem
A few off of the top of my head:
Depth-first and Breadth-first traversals, really just two different ways of touching all of the nodes.
Floyd-Warshall algorithm finds the shortest paths between any pair of points, in (big-theta)(v^3) time.
Prim's algorithm is an alternative to Kruskal's for MST.
There are also algorithms for finding fully connected components, which are groups of nodes where you can get from any member in the component to any other member. This only matters for "directed graphs", where you can traverse an edge only one direction.
Personally, I think the coolest extension of graph theory (not exactly related to your question, but if you're interested in learning more about graphs in general its certainly worth your while) is the concepts of "flow networks": http://en.wikipedia.org/wiki/Flow_network . It is a way of computing about, say, how much electricity can one distribute over houses with a variety of power needs and requirements, and a variety of power stations.
Graph algorithms
http://en.wikipedia.org/wiki/List_of_algorithms#Graph_algorithms
All algorithms in one place
http://en.wikipedia.org/wiki/List_of_algorithms
Dictionary of algorithms and data structures:
Dictionary: http://xlinux.nist.gov/dads/
By area: http://xlinux.nist.gov/dads/termsArea.html
By terms type: http://xlinux.nist.gov/dads/termsType.html
List of all implementations in diff. languages: http://xlinux.nist.gov/dads/termsImpl.html

Resources