# Compare weights in Dijkastra's Algorithm

I might have copied these values wrong or made a mistake needs suggestion. Thanks

4,9=x but i wrote 2
2,6=7 but i wrote x
7,9=1 but i wrote 5
8,9=x but i wrote 3
10,4=x but i wrote 2
10,6=x but i wrote 5

errors.jpg
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
My suggestion would be to start over.
Notice that 2,6 shows an X but 6,2 shows a 7 in the table.
If this is not a directed graph, then the table should match across the diagonal. So the table is wrong.
0
Author Commented:
Is it possible that its an indirect graph?

How to know just look at the diagram if its a direct or indirect graph?

Thanks.
0
Author Commented:
>If this is not a directed graph, then the table should match across the diagonal. So the table is wrong.

Can you please tell me if the whole table is wrong or some of the numbers needs to be change?

Thanks.
0
Author Commented:
I think I have make the table again. The matrix should be symmetric.  If 4,9=x then 9,4=x.
0
Commented:
Yes. It should be symmetric. Directed graph would have arrows.
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
if its an indirect graph can i still make a table
0
Commented:
Yes. Undirected graphs still have tables, but you only need half the table (as mentioned elsewhere. I just included it here to finish out this question).
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Math / Science

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.