all graph algorithm implemented through c