LONGEST PATH BY PRODUCT
Ältere Kommentare anzeigen
Hello,
I have an adjacency matrix (A= [0,0,0.6,0.7,0.3;0.9,0,0,0.3,0;0,0.6,0,0.9,0;0,0,0.4,0,0.9;0,0,0,0,0]) that represents the weights of edges on a 5 node graph, and I wish to find the longest (by product not sum) between two nodes. I was considering doing an element by element inverse of the matrix (1./A) then I would go ahead and apply the Dijkstra's algorithm but using this method would give me the longest path (due to the inverse funtion) based on summation, where as I need the longest path based on multiplication.
2 Kommentare
Walter Roberson
am 12 Jan. 2020
log() so sum of logs and exp() to get the product
Lala
am 26 Jan. 2020
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Dijkstra algorithm finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!