Skip to content

inNeighbors() fails on directed networks. #469

@nathaniel-hudson

Description

@nathaniel-hudson

Hello, below is a sample program that reproduces the error.

import networkit as nk

g = nk.graph.Graph(directed=True)
g.addNode()
g.addNode()
g.addEdge(0,1)

print(g.nodes())        # "[0, 1]"
print(g.inNeighbors(0)) # "[]"
print(g.inNeighbors(1)) # Error here!

On the final line of code, when node 1's in-neighbors are requested, I get the following error:

Traceback (most recent call last):
  File "Untitled.py", line 10, in <module>
    print(g.inNeighbors(1))
  File "networkit/_NetworKit.pyx", line 1061, in networkit._NetworKit.Graph.inNeighbors
  File "networkit/_NetworKit.pyx", line 1154, in networkit._NetworKit.Graph.forInEdgesOf
RuntimeError: An Exception occurred, aborting execution of iterator: lambda1() takes exactly one argument (4 given)

I've been playing around with this for a while and I've been unable to get it to work. Just thought I would bring it up so it can be addressed unilaterally soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions