TopSort result using indegree

6 views
Skip to first unread message

Long T Nguyen 6

unread,
Apr 30, 2012, 4:56:51 PM4/30/12
to cs31...@googlegroups.com
I did TopSort algorithm base on decreasing in-degree of vertices. But my result for prereq.dat is (110 140 210 240 310 450 650) because 110 and 140 have 0 in-degree at the first time. so when I put all 0 in-degree into queue, and doing decreasing in-degree, it will take the first in for out process. I am confusing with the algorithm. Did I miss something
________________________________________
From: cs31...@googlegroups.com [cs31...@googlegroups.com] on behalf of Betty O'Neil [eon...@cs.umb.edu]
Sent: Monday, April 30, 2012 12:57 PM
To: Vy Nguyen
Cc: cs31...@googlegroups.com
Subject: Re: What's the meaning of the third column in test.dat

That's for the weight (i.e. cost) of the edge.

On Sun, 29 Apr 2012, Vy Nguyen wrote:

>
> Hi professor,
> What's the meaning of the third column in test.dat?
> So A B
> means there's an edge from A to B, right? That's intuitive. I just don't understand why there's a need for a number next to [A B]Is that supposed to be the number of edges?
>
> Thank you,
> Vy
>


Betty O'Neil

unread,
Apr 30, 2012, 7:44:09 PM4/30/12
to cs31...@googlegroups.com
Don't forget that top sort order is not unique. There can be
several different top sorts that are all OK. Your order
looks fine to me.

Long T Nguyen 6

unread,
Apr 30, 2012, 7:47:02 PM4/30/12
to cs31...@googlegroups.com
Thanks Professor

________________________________________
From: cs31...@googlegroups.com [cs31...@googlegroups.com] on behalf of Betty O'Neil [eon...@cs.umb.edu]
Sent: Monday, April 30, 2012 6:44 PM
To: cs31...@googlegroups.com
Subject: Re: TopSort result using indegree
Reply all
Reply to author
Forward
0 new messages