Graph implementation in C++


Graph datastructure is one of the few datastructes which is used very commonly to solve real world problems. Infact it was invented while solving a real world problem (connecting bridges somewhere in Europe :) ). 




In this article, my attempt is to present a C++ class implementation to:


1. Represent graph datastructure (generic directed graph)


2. Perform traversal (Breadth First and Depth First).


3. Present an algorithm to detect cycles in graph if any.