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 8631157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:10:47+00:00 2026-06-12T09:10:47+00:00

In this MIT video regarding Prims algorithm for minimum spanniing tree the professor explains

  • 0

In this MIT video regarding Prims algorithm for minimum spanniing tree the professor explains π[v] ←u at time 71:16 seconds . But I do not understand why we need this step . What does this notation π[v] ←u mean actually ? Also what does the last line in the algorithm that follows mean ?
The entire algorithm given in the source is as follows :

Q←V
key[v] ←∞for all v∈V
key[s] ←0for some arbitrary s∈V
while Q≠∅
 do u←EXTRACT-MIN(Q)
   foreach v∈Adj[u]
    do ifv∈Qand w(u, v) < key[v]
      then key[v] ←w(u, v)⊳DECREASE-KEY
           π[v] ←u

At the end, {(v, π[v])}forms the MST
  • 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-06-12T09:10:47+00:00Added an answer on June 12, 2026 at 9:10 am

    π is just any old array variable. So this line of code isn’t really different from the other assignments.

    What it does in the algorithm however is save the predecessor node of the current node. π is sometimes also called the predecessor function because for any given node n, π[n] gives you the predecessor of that node (after the algorithm has completed).

    So π can be used to reconstruct the path (= the edges of the spanning tree) found by Prim’s algorithm.

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

Sidebar

Related Questions

I just copied this code from the MIT video lecture that is posted online:
I am trying to rebuild this algorithm: http://courses.csail.mit.edu/6.006/fall10/lectures/lec02.pdf (Page 14 Algorithm II) (found this
I am new to scheme. This is code sample from SICP course of MIT.
Anyone know of a more permissive license (MIT / public domain) version of this:
I know this is a very simple question, but unfortunately I don't know enough
OK I have read many posts regarding Dual Licensing using MIT and GPL licenses.
i have following problem from book introduction algorithm second edition by MIT university problem
This is a problem on Asymptotic Notation from the assignment of MIT OpenCourse Introduction
This page summarizes different license types' terms (GPL, LGPL, MIT, BSD, etc): http://www.codeproject.com/info/Licenses.aspx Say
I'm porting some code from lisp, but I got stuck at this part (apparently

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.