## Maximize number of nodes which are not part of any edge in a Graph

Given a graph with n nodes and m edges. Find the maximum possible number of nodes which are not part of any edge (m will… Read More »

## Basic Properties of a Graph

A Graph is a non-linear data structure consisting of nodes and edges. The nodes are sometimes also referred to as vertices and the edges are… Read More »

## Transpose graph

Transpose of a directed graph G is another directed graph on the same set of vertices with all of the edges reversed compared to the… Read More »

## Find the Degree of a Particular vertex in a Graph

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 »

## Graph representations using set and hash

We have introduced Graph implementation using array of vectors in Graph implementation using STL for competitive programming | Set 1. In this post, a different… Read More »

## Graph and its representations

Graph is a data structure that consists of following two components: 1. A finite set of vertices also called as nodes. 2. A finite set… Read More »

## Breadth First Search or BFS for a Graph

Breadth First Traversal (or Search) for a graph is similar to Breadth First Traversal of a tree (See method 2 of this post). The only… Read More »

## Depth First Search or DFS for a Graph

Depth First Traversal (or Search) for a graph is similar to Depth First Traversal of a tree. The only catch here is, unlike trees, graphs… Read More »