Adding graph algorithms