Implementation of a graph data structure and graph algorithms