some classical graph algorithm implement