Refactoring to use GraphUtil::addEdge()