Added some exceptions.

NegativeEdgeWeight, NotDiGraph, NotUndirectedGraph exceptions and throw
them in use!