Adding methods for network graph

This is a step to remove the dependency of grit from class Network::Graph.

+ https://github.com/gitlabhq/gitlabhq/blob/master/app/models/network/graph.rb#L113
+ https://github.com/gitlabhq/gitlabhq/blob/master/app/models/network/graph.rb#L130