Some graph algorithms