Added a function to do some graph processing. I need to write it.