Participating in Marlin FlowMint as a Cosmos delegator and validator

FlowMint is a mechanism to distribute Marlin tokens (MPOND) amongst token holders of different blockchains who stake towards eligible validators. A total of 20% of Marlin’s genesis supply will be…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




DFS Critical connections

This article talks about one of the most useful applications of DFS(Depth-first search) to identify vulnerabilities in a connected network with a goal to design a reliable networking system. Today, we are going to see how DFS solves this problem.

Before jumping directly on to the algorithm, we need to understand a few fundamental concepts in the graph.

Connected graph: Connectivity in an undirected graph means that every vertex can reach every other vertex via any path. If the graph is not connected, the graph can be broken down into Connected Components. Similarly, a graph where every vertex cannot reach every other vertex via any path results in a disconnected graph.

Above figure shows how a connected graph turns into a disconnected graph when we remove a edge between two vertex
The Above figure shows how a connected graph turns into a disconnected graph when an edge between two vertexes is removed. [ Edge (4,5) is removed to make it disconnected ]

Articulation point (AP): is nothing but a vertex that acts as a middleman between the two vertexes. It means if we remove AP vertex from the graph, the communication between those two vertexes is completely lost. In simple terms, AP is a node in a graph which when removed, separates the graph into two different disconnected graphs.

The above figures show some examples of articulation points.

Bridges: Similarly, the bridge is nothing but a communication channel from the articulation point and its child. In simple terms, a bridge is an edge between two different sub-graphs which when removed results in separate graphs.

The above figure shows a good example of a reliable network where there is no bridge.
The above figure shows a network graph where there are two bridges present which when removed created two different components of the graph.

Now, given that we know what is articulation point and bridges. Both the terms help us to validate a given network graph/system against the vulnerabilities. Let’s say now that we have a problem statement where we have to check if the graph has bridges or not. OR in other terms, we have to find if there are any critical connections present in the graph which can cause the system to break/disconnect.

To do so, we can achieve it by simply following the above steps which we discussed earlier.

Step 1 : One by one remove an edge from the graph.

Step 2 : When an edge is removed from the graph, perform traversing[DFS] on the graph and see if all the vertexes are visited. If any vertex remains unvisited, then the edge causing the problem is nothing but a critical connection.

The time complexity of above approach is O(E*(V+E)) where (V+E) is for traversing the graph. Since we have to perform DFS at each step after removing the edge. Therefore, it is O(E*(V+E))

There is a better solution which is called “Tarjan's algorithm”. You can refer the same in the below link

Add a comment

Related posts:

The Ultimate Crypto Witch Club web3 Follow List

Is this list all inclusive? Certainly not — but these are some of our favorite power players and web3 voices making major moves in the space. (In no particular order.) Make sure to check out their…

How to Build a Successful Workplace Culture

Imagine taking over a cycling team that hasn’t won an Olympic medal in almost one hundred years. Which approach would you choose? That’s the dilemma Dave Brailsford faced in 2002 when he became the…

What is real love?

What is real love? Love, in my view, is just this: supporting, contributing and celebrating to the evolution and growth of the one(s) you love⁣. This is quite different from some expressions of…