I am implementing the bellman ford algorithm. I\'m given a directed, weighted graph with G nodes, and I need to output the shortest distance. I am using the adjacency matrix