Made function parameter as reference type

Made a parameter of the GraphUtil function as reference.