Tables 2.4 - General single-source shortest-path strategy 1 Start by calling INIT-SINGLE-SOURCE 2 Relax Edges Algorithms differ in the order in

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: General single-source shortest-path strategy 1. Start by calling INIT-SINGLE-SOURCE 2. Relax Edges Algorithms differ in the order in which edges are taken and how many times each edge is relaxed. CSE 2011 Prof. J. Elder - 181 - Last Updated: 4/1/10 10:16 AM Example 1. Single-Source Shortest Path on a Directed Acyclic Graph Basic Idea: topologically sort nodes and relax in linear order. Efficient, since [u] (shortest distance to u) has already been computed when edge (u,v) is relaxed. Thus we only relax each edge once, and never have to backtrack. CSE 2011 Prof. J. Elder - 182 - Last Updated: 4/1/10 10:16 AM Example: Single-source shortest paths in a directed acyclic graph (DAG) Since graph is a DAG, we are guaranteed no negative-weight cycles. Thus algorithm can handle negative edges CSE 2011 Prof. J. Elder - 183 - Last Updated: 4/1/10 10:16 AM Algorithm CSE 2011 Prof. J. Elder - 184 - Last Updated: 4/1/10 10:16 AM Example CSE 2011 Prof. J. Elder - 185 - Last Updated: 4/1/10 10:16 AM ...
View Full Document

This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

Ask a homework question - tutors are online