Graph Algorithms in SQL
Strongly Connected Components
The Strongly Connected Components algorithm finds sets of connected nodes in a directed graph. A directed graph is a graph that has a path from each node to every other node. A set is considered a strongly connected component if there is a directed path (relationship) between each pair of nodes within the set. On the other hand, if the nodes are only connected through one direction that would be considered a weakly connected component.
![](https://timbr.ai/wp-content/uploads/2021/11/Strongly-Connected-Components1-1024x275.jpg)
Strongly connected components identified
Sample use cases
![](https://timbr.ai/wp-content/uploads/2021/11/finance-1.png)
Financial
Finding groups of firms in which every member owns shares directly or indirectly, of every other member’s shares
![](https://timbr.ai/wp-content/uploads/2021/11/social-4.png)
Social Media
Suggesting commonly liked pages or games to people in a connected group
![](https://timbr.ai/wp-content/uploads/2021/11/ML.png)
Machine Learning
Testing correctness of various components in machine learning models
![](https://timbr.ai/wp-content/uploads/2021/11/Telecommunications-2.png)
Telecommunications
Measuring routing performance in multi-hop wireless networks
![](https://timbr.ai/wp-content/uploads/2021/11/Transportation-2.png)
Transportation
Modeling road networks in vehicle routing applications