Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 736841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:39:05+00:00 2026-05-14T07:39:05+00:00

I’m reviewing my old algorithms notes and have come across this proof. It was

  • 0

I’m reviewing my old algorithms notes and have come across this proof. It was from an assignment I had and I got it correct, but I feel that the proof certainly lacks.

The question is to prove that the distance values taken from the priority queue in Dijkstra's algorithm is a non-decreasing sequence.

My proof goes as follows:

Proof by contradiction. Fist, assume
that we pull a vertex from Q with
d-value ‘i’. Next time, we pull a
vertex with d-value ‘j’. When we
pulled i, we have finalised our
d-value and computed the shortest-path
from the start vertex, s, to i. Since
we have positive edge weights, it is
impossible for our d-values to shrink
as we add vertices to our path. If
after pulling i from Q, we pull j with
a smaller d-value, we may not have a
shortest path to i, since we may be
able to reach i through j. However,
we have already computed the shortest
path to i. We did not check a
possible path. We no longer have a
guaranteed path. Contradiction.

How could this proof be improved upon? Or better yet, is there a different approach? It just seems pretty weak 🙂

Edit: Sorry, in this case my priority queue is implemented with a Min-heap

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:39:06+00:00Added an answer on May 14, 2026 at 7:39 am

    Let’s establish these (these are all true, since they are, basically, the definition of the algorithm) :

    1. The Priority Queue in Dijkstra’s algorithm will give you the node with the lowest d-value in each iteration of the algorithm.
    2. There are no negative edge weights.
    3. Once a node has been dequeued, it will never return to the queue.
    4. The d-value of a node that has been dequeued is final, and will not change from that point on.

    Continuing (1), the d-value of that dequeued node, assuming (2) applies, will be at the very least equal to the previous d-value extracted, since each node’s d-value depends on the d-values of the nodes dequeued prior to it, which is a sort of recursive definition. Since (3) and (4) are correct, this recursive definition ends at the starting node which has d-value of 0.
    So, if each node’s d-value is at the very least equal to the d-value before him, and (1) still applies, the set of d-values extracted from the priority queue is non-decreasing.

    (After reading through this, and what you wrote, it’s basically the same, but presented a bit better I think)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.