Finish implementation

But because I make the weight of an edge as the key of the dictionary
any graph with more than a single edge with the same weight will
yield wrong result.

Signed-off-by: Aditya Prasad <adityaprasadiskool@gmail.com>