Bridges in Graph
Critical Connections in a Network - Tarjan’s Algorithm
Search for a command to run...
Articles tagged with #graphs
Critical Connections in a Network - Tarjan’s Algorithm
Problem Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account. Now, we would like to merge these acco...
Problem Given a weighted, undirected, and connected graph with V vertices and E edges, the task is to find the sum of the weights of the edges in the Minimum Spanning Tree (MST) of the graph using Kruskal's Algorithm. The graph is represented as an e...
Introduction A disjoint set is a data structure that helps determine if two nodes are part of the same component efficiently. While BFS or DFS can be used to check this, a disjoint set can perform the task in constant time. It is particularly useful ...
Spanning Tree A tree in which we have N nodes and N-1 edges and all nodes are reachable from each other. Some of the possible Spannig trees Minimum Spanning Tree A spanning tree where the total sum of all the edges is the smallest possible is call...
Problem You are given an weighted directed graph, represented by an adjacency matrix, dist[][] of size n x n, where dist[i][j] represents the weight of the edge from node i to node j. If there is no direct edge, dist[i][j] is set to a large value (i....