Accueil > Term: DAG shortest paths
DAG shortest paths
Solve the single-source shortest-path problem in a weighted directed acyclic graph by 1) doing a topological sort on the vertices by edge so vertices with no incoming edges are first and vertices with only incoming edges are last, 2) assign an infinite distance to every vertex (dist(v)=∞) and a zero distance to the source, and 3) for each vertex v in sorted order, for each outgoing edge e(v,u), if dist(v) + weight(e) < dist(u), set dist(u)=dist(v) + weight(e) and the predecessor of u to v.
- Partie du discours : noun
- Secteur d’activité/Domaine : Informatique
- Catégorie : Algorithms & data structures
- Government Agency: NIST
0
Créateur
- GeorgeV
- 100% positive feedback