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…
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.
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.
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.
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
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…
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? 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…