## Minimum cost to connect all cities

There are n cities and there are roads in between some of the cities. Somehow all the roads are damaged simultaneously. We have to repair… Read More »

There are n cities and there are roads in between some of the cities. Somehow all the roads are damaged simultaneously. We have to repair… Read More »

Given n nodes of a forest (collection of trees), find the number of trees in the forest. Examples : Input : edges[] = {0, 1},… Read More »

There is a m*n rectangular matrix whose top-left(start) location is (1, 1) and bottom-right(end) location is (m*n). There are k circles each with radius r.… Read More »

Breadth-first search traversal of a graph using the algorithm given in CLRS book. BFS is one of the ways to traverse a graph. It is… Read More »

We are given a tree of size n as array parent[0..n-1] where every index i in parent[] represents a node and the value at i… Read More »

Given a graph G(V,E) as an adjacency matrix representation and a vertex, find the degree of the vertex v in the graph. Examples: 0—–1 |\… Read More »

Given an undirected graph and a set of vertices, we have to count the number of non reachable nodes from the given head node using… Read More »

BFS(Breadth First Search) is a graph traversal technique where a node and its neighbors are visited first and then the neighbors of neighbors. In simple… Read More »

The current article would deal with the concepts surrounding the complex networks using the python library Networkx. It is a Python language software package for… Read More »

In graph theory, the Katz centrality of a node is a measure of centrality in a network. It was introduced by Leo Katz in 1953… Read More »

Check whether a given graph contains a cycle or not. Example 1: Input: Output: Graph contains Cycle. Example 2: Input: Output: Graph does not contain… Read More »

This is a C++ program to generate a graph for a given fixed degree sequence.This algorithm generates a undirected graph for the given degree sequence.It… Read More »

Given a tree represented as undirected graph. Count the number of nodes at given level l. It may be assumed that vertex 0 is root… Read More »

Count the total number of ways or paths that exist between two vertices in a directed graph. These paths doesn’t contain a cycle, the simple… Read More »

We are given a matrix that contains different values in its each cell. Our aim is to find the minimal set of positions in the… Read More »