
Why would some paths have significantly more / less weights than other equal length paths? In Dijkstra’s do length and path weight not equate?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You mean that the graphical representation of the
graphdoesn’t correspond to theweighteach path has ?They don’t have too… the visual representation is just a representation, nothing else. It isn’t oblied be equivalent of the weight.
You could redraw the graph anyway you like, just making sure that the connections between the vertices are kept.
Edit: and it doesn’t matter what kind of graph you’re dealing with, be it Dijkstra or any other. You can even fidn graphs where the direction matters: From A to B the weight can be 10 and from B to A the weight can be 30. No problem.
Edit 2: the image just shows how the vertices connect to each other. The image doesn’t need to be in scale with the graph that is stored in your program. Sometimes you’ll have graphs with so many vertices and edges that you won’t be able to represent it in a good way. What matters for your programing problems are the vertices, the edges, and it’s weights. The image is just a rough representation of it. You can redraw the image as you like, you just have to make sure to put all vertices, all edges, and all weights for each edge.