graph algorithms ii 951988