Skip to content

[joss] Bad result from degree() method with self loops #517

@szhorvat

Description

@szhorvat

The .degree() method returns incorrect (or at least very unusual) results for undirected graphs with self-loops.

Example:

g3 = rx.PyGraph()
g3.extend_from_edge_list([(0,1), (0,0)])

g3.degree(0)
2

The correct result is 3. Note that the degree is not the same as the number of incident edges. It is the number of edge endpoints.

Certainly, one may reinterpret the meaning of "degree", but diverging from the de-facto standard textbook definition is not a good idea. It is going to be extremely confusing for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions