Skip to content

Category Archives: Graph

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. Unfortunately, there is no efficient… Read More
Graph coloring problem is to assign colors to certain elements of a graph subject to certain constraints.  Vertex coloring is the most common graph coloring… Read More
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.… Read More
Travelling Salesman Problem (TSP): Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible route… Read More
Given an undirected graph, how to check if there is a cycle in the graph? Example,  Input: n = 4, e = 4 Output: Yes Explanation: 0 1, 1… Read More
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
  Given a Weighted Directed Acyclic Graph (DAG) and a source vertex s in it, find the longest distances from s to all other vertices… 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 same… Read More
The Stable Marriage Problem states that given N men and N women, where each person has ranked all members of the opposite sex in order… Read More
In a flow network, an s-t cut is a cut that requires the source ‘s’ and the sink ‘t’ to be in different subsets, and… Read More
A matching in a Bipartite Graph is a set of the edges chosen in such a way that no two edges share an endpoint. A… Read More
  Given a graph which represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink ‘t’ in… 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

Start Your Coding Journey Now!