some basic graph algorithms  with adjlist and matrix implementation.