Clusters

2 views
Skip to first unread message

Shraya Ramani

unread,
May 7, 2011, 8:44:54 PM5/7/11
to cs2110-sp11
I'm getting the same numbers of clusters as everybody else for the
small graphs so i assume my methods are functionally correct, but i'm
getting stack overflows when i try to count/set clusters for the large
graphs. has anybody else had this problem?

Robert Escriva

unread,
May 7, 2011, 9:06:57 PM5/7/11
to cornell-c...@googlegroups.com

Stacks are of finite size. When running DFS, you create one stack frame
for each vertex you visit. It then follows that if you create enough
stack frames, you will overflow the stack.

Try declaring less on the stack, or manually managing the stack instead
of using recursion.

My implementation manually manages the stack. Christie's implementation
uses BFS. Both are equally correct.

-Robert

Reply all
Reply to author
Forward
0 new messages