Implementation of standard graph algorithms