I have rectangle graph represented by two-dimensional table (I cannot change the form of graph representing) like that :
bool graph[n][m]; //where n and m are dimensions of rectangle
It looks generally like that :
My question is : What's best way in my case to represent distances between graph's vertexes ?
And : How can I use in that case BFS of Dijkstry alghoritm to find shortest path from graph[x0][y0]
to graph[x1][y1]
?
I tried to search in internet for proper solution, but I saw only codes based on vectors, lists and struct(s).
IMPORTANT EDIT :
I'm sorry very well. My graph is rectangle only at the beginning. Then it is getting some changes (in distances between vertexes) and changing is form to something different. Please get attetion on that.