Added some graph algorithm code. hope this will help others .