Skip to content

Changed behavior of Graph.Biadjacency in igraph 1.0 #863

@jboynyc

Description

@jboynyc

Describe the bug

Creating a bipartite graph from a biadjacency matrix works in subtly different ways in igraph 0.11 and 1.0.

To reproduce

import numpy as np

m = np.array(range(1, 10)).reshape(3,3)

import igraph as ig

ig.__version__
# => '0.11.8'

ig.Graph.Biadjacency(m.tolist(), weighted=True).es["weight"]
# => [1, 2, 3, 4, 5, 6, 7, 8, 9]

ig.__version__
# => '1.0.0'

ig.Graph.Biadjacency(m.tolist(), weighted=True).es["weight"]
# => [1, 4, 7, 2, 5, 8, 3, 6, 9]

The behavior in igraph 1.0 is the equivalent of calling Graph.Biadjacency on the transposed biadjacency matrix in igraph 0.11:

ig.Graph.Biadjacency(m.T.tolist(), weighted=True).es["weight"]
# => [1, 4, 7, 2, 5, 8, 3, 6, 9]

Version information

0.11.8 and 1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions