Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Wrong count in undirected adjacency matrix #129

Description

@hackl

The count value (i.e. which will increase when the edge is added multiple times) does not work for undirected networks

import pathpy as pp

net = pp.Network(directed=False)
net.add_nodes('a', 'b', 'c')

net.add_edge('a', 'b')
net.add_edge('a', 'b')
net.add_edge('a', 'b')
net.add_edge('b', 'a')

T = net.adjacency_matrix(count=True)
print(T.todense())

[[0. 4. 0.]
 [1. 0. 0.]
 [0. 0. 0.]]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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