algorithm - Dijkstra with Parallel edges and self-loop -


if have weighted undirected graph no negative weights, can contain multiple edges between vertex , self-loops, can run dijkstra algorithm without problem find minimum path between source , destination or exists counterexample? graph

my guess there not problem, want sure.

if you're going run dijkstra's algorithm without making changes graph, there's chance you'll not shortest path between source , destination.

for example, consider s , o. now, finding shortest path depends on edge being being traversed when want push o queue. if code picks edge weight 1, you're fine. if code picks edge weight 8, algorithm going give wrong answer.

this means algorithm's correctness dependent on order of edges entered in adjacency list of source node.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -