Real world applications where spanning tree data structure is used - data-structures

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.

Related

How can I add resilience to a minimum spanning tree?

I have a complete, weighted, undirected graph. The edge weights are the cost of a connection between two nodes, so the minimum spanning tree is the subset of the edges with the lowest total cost such that the graph remains connected.
The MST must be connected at all times, but unfortunately the connections aren't very reliable, so I would like to add redundancy to this graph/network.
Is it possible to compute a subset of edges such that the total edge cost is minimised and edge-connectivity is over a certain minimum?
I can see how it would be possible by bruteforcing, but I was looking for something more practical. I haven't been able to find much about this problem, I think mainly because I don't posses the vocabulary necessary to search.
My current idea is:
Compute the MST
While the it is still below a certain connectivity
Find a node most below that connectivity
Activate that node's edge with the lowest weight
The reason I don't find all the nodes below a certain connectivity all at once is because activating an edge may give another one enough connectivity.
I'm pretty sure this does not yield 100% provably optimal networks, because with this method, it is possible to over-connect nodes (e.g. you activate k edges for a node, then another node activates more shared edges, making some of those k redundant). I hope that makes sense.
Any tips would be much appreciated!
The Wikipedia article on edge connected graphs ends with, A related problem: finding the minimum k-edge-connected spanning subgraph of G (that is: select as few as possible edges in G that your selection is k-edge-connected) is NP-hard for k >= 2. They then cite a 1979 paper that shows it.
Therefore I'd suggest taking a greedy approach, and tip-toeing away.

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.

Optimal distribution of power plants on a city

I've searched both Google and Stack Overflow for an answer to my problem but I can't find one.
I need to find the optimal distribution for the power network of a city. The city is represented by a connected graph. I want to distribute power plants among some of those nodes in order to cover all of them in the electrical grid. The problem being that every power plant has a certain "range" (it can only cover for example in a "radius" of two nodes). My program needs to find the minimum number of power plants and their locations to cover the entire city.
I know from my searches that it should be related to MST's (minimum spanning trees) but the problem is in the limited range of the power plants.
I've thought about going through every node in the city and calculate the sub-graph containing all nodes within the range of a power plant in that node until I find the one that covers the most uncovered nodes and then keep doing that until the entire city is covered (basically brute forcing the problem) but that seems very unpractical and I was wondering if there is any other more effective way to solve this problem.
Thanks.
Unfortunately, this problem is known to be NP-hard by a reduction from the dominating set problem.
Given a graph G, a dominating set in G is a set of nodes D such that every node in the graph is either in D or is one hop away from D. The problem of finding the smallest dominating set in a graph is known to be NP-hard, and this problem easily reduces to the one you're trying to solve: given a graph G, produce a city (represented as a graph) that has the same structure as G, then give every power plant a radius of 1 (meaning that it can cover a node and all its neighbors). Finding the smallest set of power plants to cover the entire city then ends up producing a dominating set for the graph. Therefore, your problem is NP-hard.
As mentioned in this section of the Wikipedia page, it turns out that this problem is surprisingly hard to approximate. The Wikipedia page lists a few algorithms and approaches for approximating it, but it appears to be one of those NP-hard problems that resists polynomial-time approximation schemes.
Hope this helps!

Applications of Kruskal and Prim's algorithms

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.

how to find Connected Component dynamically

Using disjoint-set data structure can easily get connected component of Graph. And, it just supports Incremental Connected Components.
However, in my case, removing edge is very common so that I am looking for an algorithm or new structure can maintain Connected Components fully dynamically(including adding and removing edge)
Thanks
Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity (Holm, de Lichtenberg and Thorup 2001) gives an algorithm that allows an arbitrary sequence of edge insertions, deletions and connectivity queries, with updates (insertions and deletions) taking O(log(n)^2) amortised time, and queries taking O(log(n)/log(log(n))) time, with n being the number of vertices in the graph. These time bounds assume that the graph starts with no edges.
I only skimmed the first 2 of its 38 pages, but don't be (too) scared -- the paper describes a bunch of new algorithms on dynamic graphs (that is, graphs that can be efficiently modified over time) of which connectivity is the simplest.

Resources