Performance and correctness of Graph methods

Improved performance of edgeNum function.
Random Git Crap