add graph algorithm, not complete