Skip to content

get_adjacency_sparse broken with scipy 1.13 and empty graphs #871

Closed

Description

@flying-sheep

Describe the bug

get_adjacency_sparse does sparse.csr_matrix((weights, list(zip(*edges))), shape=(N, N))

Since scipy 1.13, the constructor apparently expects edge tuples of length 2, and with an empty graph, zip(*edges) becomes ().

To reproduce

Call get_adjacency_sparse with scipy 1.13+ installed and you will see

ValueError: mismatching number of index arrays for shape; got 0, expected 2

Version information
1.0.0 from PyPI

Activity

  1. changed the title [-]`get_adjacency_sparse` broken with scipy 1.13[/-] [+]`get_adjacency_sparse` broken with scipy 1.13 and empty graphs[/+] on Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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