Added graph utility functions