Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From Introduction to Algorithms by Cormen et al:

We are given a directed graph G = (V,E) and vertices ${u,v}\in V $ and then the define Unweighted shortest path to be :

Find a path from u to v consisting of the fewest edges . Such a path must be simple , since removing a cycle from a path produces a path with fewer edges.

I know what simple path means . I think it means that basically no edges will be repeated in the path from u to v but what does "removing a cycle from a path produces a path with fewer edges" mean ?

share|cite|improve this question
up vote 2 down vote accepted

Simply speaking, if we have vertices v1, v2, v3, v4, v5... and our path contains a cycle eg v1 -> v2 -> v4 -> v3 -> v2 -> v5 we can travel from v1 -> v5 over fewer edges by eliminating the cycle v2 -> v4 -> v3 -> v2, leaving the path v1 -> v2 -> v5

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.