graph algorithms adapted from umd jimmy lin s slides which published presentations and documents on DocSlides.