Graph API used for graph algorithm