Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

degree versus in_degree

I have a problem when calling degree and in_degree on directed graph I loaded. In particular, I had thought, for a particular node, that degree = in + out degree but am getting a situation where in_degree > degree for a given node. Here is the output for a graph I loaded:

sage: T.in_degree(vertices=[0],labels=True)

{0: 628}

sage: T.degree(vertices=[0],labels=True)

{0: 394}

This is also the case for other nodes in the graph.

Any idea what's going on here?

thanks! --David

degree versus in_degree

I have a problem when calling degree and in_degree on directed graph I loaded. In particular, I had thought, for a particular node, that degree = in + out degree but am getting a situation where in_degree > degree for a given node. Here is the output for a graph I loaded:

sage: T.in_degree(vertices=[0],labels=True)

T.in_degree(vertices=[0],labels=True) {0: 628}

628} sage: T.degree(vertices=[0],labels=True)

T.degree(vertices=[0],labels=True) {0: 394}

394}

This is also the case for other nodes in the graph.

Any idea what's going on here?

thanks! --David