Fixed some bugs and improve Graph type

Fixed duplicated insertion of neighbors
and improved graph type definition and
dot vizualization by graph type.