Skip to content

.canonical_label() errors on bipartite graphs when partition= is not specified #38832

Closed
@maxale

Description

@maxale

Steps To Reproduce

sage: G = BipartiteGraph( matrix([[1,1],[1,1]]) )
sage: G.canonical_label()
[...]
TypeError: itertools.chain() argument after * must be an iterable, not NoneType

Expected Behavior

Should work.

Actual Behavior

TypeError

Additional Information

Specifying partition= eliminates the issue:

sage: G.canonical_label(partition=G.bipartition())
Bipartite graph on 4 vertices

Perhaps, G.bipartition() should be the default value for partition= in the case of bipartite graphs.

Environment

  • OS: Ubuntu 24.04.1 LTS
  • Sage Version: 10.5.beta6

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions