Should self-edges be kept?

8 views
Skip to first unread message

Peter

unread,
May 5, 2011, 4:31:35 PM5/5/11
to cs2110-sp11
It seems that from the posts, self-edges are ignored in the
calculations.
For example, in/out degree do not consider self-edges.

Is it okay to simply not add such edges in the first place, or are
they needed for anything?

Nishant George

unread,
May 5, 2011, 5:10:16 PM5/5/11
to cornell-c...@googlegroups.com
In/out degree DOES count self edges.
--
Nishant George
Cornell University '11
Applied & Engineering Physics

Peter

unread,
May 5, 2011, 6:55:43 PM5/5/11
to cs2110-sp11
I thought Robert E. posted somewhere that it shouldn't be counted.

On May 5, 5:10 pm, Nishant George <skarlath...@gmail.com> wrote:
> In/out degree DOES count self edges.
>

Robert

unread,
May 5, 2011, 7:22:57 PM5/5/11
to cs2110-sp11

Peter

unread,
May 7, 2011, 5:00:21 PM5/7/11
to cs2110-sp11
So can we just not add these edges in the first place. I'm wondering b/
c this would make inDegree and outDegree more efficient, as we can
just call the size of the appropriate list to get the number of
outgoing or incoming edges.

On May 5, 7:22 pm, Robert <robert.rav...@gmail.com> wrote:
> Last post:
>
> http://groups.google.com/group/cornell-cs2110-sp11/browse_thread/thre...

Robert Escriva

unread,
May 7, 2011, 9:03:19 PM5/7/11
to cornell-c...@googlegroups.com
Self-edges affect in/out degree.

If I do:

addVertex(31337);
addEdge(31337, 31337, 1337);

I expect that it will succeed. Further more, the in and out degrees of vertex
31337 should both be 1.

-Robert

Reply all
Reply to author
Forward
0 new messages