A directed graph is strongly connected if there is a path between all pairs of vertices.
Given a directed and two vertices ‘u’ and ‘v’ in it, find shortest path from ‘u’ to ‘v’ with exactly k edges on the path.
Given a directed graph and two vertices ‘u’ and ‘v’ in it, count all possible walks from ‘u’ to ‘v’ with exactly k edges on… Read More »
Eulerian Path is a path in graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path which starts and ends on the… Read More »
Given an array of strings, find if the given strings can be chained to form a circle.
Given a sorted dictionary (array of words) of an alien language, find order of characters in the language.
There are M transmitter and N receiver stations. Given a matrix that keeps track of the number of packets to be transmitted from a given… Read More »
Question 1: Given a directed weighted graph. You are also given the shortest path from a source vertex ‘s’ to a destination vertex ‘t’. If… Read More »
We introduced graph coloring and applications in previous post. As discussed in the previous post, graph coloring is widely used.
Graph coloring problem is to assign colors to certain elements of a graph subject to certain constraints.
The problem is to find shortest paths between every pair of vertices in a given weighted directed Graph and weights may be negative. We have… Read More »
We introduced Travelling Salesman Problem and discussed Naive and Dynamic Programming Solutions for the problem in the previous post,. Both of the solutions are infeasible.
Travelling Salesman Problem (TSP): Given a set of cities and distance between every pair of cities, the problem is to find the shortest p
Given an undirected graph, how to check if there is a cycle in the graph? For example, the following graph has a cycle 1-0-2-1.
Given a directed graph and two vertices in it, source ‘s’ and destination ‘t’, find out the maximum number of edge disjoint paths from s… Read More »