add graph algorithms