TopSortDemo and the random graphs

6 views
Skip to first unread message

Christopher G Kelly 5

unread,
Apr 30, 2012, 3:35:01 PM4/30/12
to cs31...@googlegroups.com
Prof. O'Neil,
Some of us have been running the TopSortDemo but it seems to keep producing graphs with cycles.  Since it's produced randomly, I presume one would have to run the demo repeatedly, many times, in order to get a true acyclic graph.  (In my own version, the demo will run and light up the nodes until it reaches a cycle, after which it stops.)  Is this okay, so far as the assignment is concerned?
Thanks,
Chris

Vy Nguyen

unread,
Apr 30, 2012, 3:36:42 PM4/30/12
to cs31...@googlegroups.com
Or do we need to write some function to remove the cycles from a graph before passing it to TopSortDemo? 

--
Vy

From: Christophe...@umb.edu
To: cs31...@googlegroups.com
Subject: TopSortDemo and the random graphs
Date: Mon, 30 Apr 2012 19:35:01 +0000

Betty O'Neil

unread,
Apr 30, 2012, 3:44:39 PM4/30/12
to Vy Nguyen, cs31...@googlegroups.com
You can change the generateGraph code to remove more edges--that
will make it much less likely to have a cycle.

On Mon, 30 Apr 2012, Vy Nguyen wrote:

>
> Or do we need to write some function to remove the cycles from a graph before passing it to TopSortDemo?
> --Vy
Reply all
Reply to author
Forward
0 new messages