New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add to_digraph method to Permutation #30214
Comments
Author: David Coudert |
comment:1
This should do what you want. New commits:
|
Commit: |
Branch: public/combinat/30214_to_digraph |
comment:3
Personally, I would do -E = [(i + 1, self[i]) for i in range(len(self))]
+E = list(enumerate(self, start=1))) Do you agree? |
Reviewer: Sébastien Labbé |
comment:5
Replying to @seblabbe:
+1 |
comment:7
Indeed a better solution. I'm also avoiding the creation of the list. |
comment:8
good, I was not sure if it takes an iterable as well. even better. |
comment:9
When the input format is specified, you can give an iterator. Otherwise... |
This comment has been minimized.
This comment has been minimized.
Changed branch from public/combinat/30214_to_digraph to |
Before this ticket, the
show
method for a permutationThis ticket adds a
to_digraph
method to return the graphand changes the
show
method to use it.This allows the following:
Inspired by a question by Ask Sage user magviana:
CC: @slel
Component: combinatorics
Keywords: permutation
Author: David Coudert
Branch/Commit:
12cadec
Reviewer: Sébastien Labbé
Issue created by migration from https://trac.sagemath.org/ticket/30214
The text was updated successfully, but these errors were encountered: