Updated the Graph with in edges count check