Skip to content

Graph.relabel() misinterprets elements of .automorphism_group() #37379

@maxale

Description

@maxale

Steps To Reproduce

Each element of automorphism group acts on the graph vertices by permuting (relabeling) them. It is therefore very natural for .relabel() to support automorphism group's elements.

sage: G = graphs.CycleGraph(5)
sage: A = G.automorphism_group()
sage: H = G.random_orientation()
sage: a = A.random_element()
sage: print(a)
(0,3,1,4,2)
sage: H.relabel(a,inplace=False).show()

Expected Behavior

For a given automorphism a, each graph vertex v should be relabeled into a(v).

Actual Behavior

At the moment .relabel() misunderstands a given graph's automorphism by issuing an wrongful error message NotImplementedError: Non injective relabeling. Elements of automorphism group do define injective labeling.

Additional Information

A workaround is to call H.relabel(lambda v: a(v),...) instead of H.relabel(a,...).

Environment

- **OS**: Ubuntu 22.04.3 LTS
- **Sage Version**: 10.3.beta7

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

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