Welcome to our community

Be a part of something great, join today!

Directed Graph

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,047
Helloo!!!

I am asked to find the weights of the shortest path from s in a directed Graph G=(V,E), where V={s,a,b,c,d}, E={(s,a),(s,d),(a,b),(a,c),(a,d),(b,s),(b,c),(c,b),(d,a)} and their weights 5,3,6,4,1,3,7,2,2...
I used Dijkstra's Algorithm, and I found d=0,d[a]=5,d=11,d[c]=9,d[d]=3... Is this correct??
 
Last edited by a moderator:

Ackbach

Indicium Physicus
Staff member
Jan 26, 2012
4,193
Helloo!!!

I am asked to find the weights of the shortest path from s in a directed Graph G=(V,E), where V={s,a,b,c,d}, E={(s,a),(s,d),(a,b),(a,c),(a,d),(b,s),(b,c),(c,b),(d,a)} and their weights 5,3,6,4,1,3,7,2,2...
I used Dijkstra's Algorithm, and I found d=0,d[a]=5,d=11,d[c]=9,d[d]=3... Is this correct??


That's what I get as well.
 

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,047
Great...!!! :) Thank you!!!