Re: [sage-combinat-devel] Re: Test digraph for cycles containing a vertex?

2015-06-22 Thread Tom Boothby
This is a little silly, sage: any(v == x for x in d.breadth_first_search(d.neighbors_out(v))) as sage: v in d.breadth_first_search(d.neighbors_out(v)) is equivalent, easier to read, and a tiny bit faster. On Mon, Jun 22, 2015 at 4:32 AM, Nathann Cohen wrote: >> Probably that won't be needed.

Re: [sage-combinat-devel] Gray code

2013-12-04 Thread Tom Boothby
I implemented something similar for permutations 'cause I needed it: http://hg.sagemath.org/sage-main/src/f0ee3538887fe739601babb54e177ec5e1133b7a/sage/combinat/permutation_cython.pyx?at=default On Wed, Dec 4, 2013 at 1:52 PM, Nathann Cohen wrote: > Helloo everybody ! > > I got an email from

Re: [sage-combinat-devel] Drawings for Permutations -- how would you plot them ?

2012-04-24 Thread Tom Boothby
I typically draw them top-to-bottom. I've seen them called "string diagrams" by people in pattern avoidance. On Tue, Apr 24, 2012 at 8:24 AM, Nathann Cohen wrote: > Helloo everybody !!! > > Because of a former post on this google group [1] I created the following > patch [2]. It adds to Perm

Re: [sage-combinat-devel] Catalan

2012-03-26 Thread Tom Boothby
Yes, this was suggested to me after I'd abandoned the catalog I posted. I'm fairly sure that most, if not all of my bijections follow directly from the recursive structure of Catalan objects. On Mon, Mar 26, 2012 at 10:25 AM, matthew Drescher wrote: > i would be interested. I had it in mind to f

Re: [sage-combinat-devel] Catalan

2012-03-26 Thread Tom Boothby
Christian, this is far from standard. It's fairly discombobulated scratch work. The objects aren't even classes. If you look for the cell that starts out: CatCat = CatalanCatalog() CatCat.add_type('c','binary tree',... and execute that, then things should work better for you. The relevant cel

Re: [sage-combinat-devel] Catalan

2012-03-25 Thread Tom Boothby
Darn, that's a bug in the notebook. Let's see if a less-busy server is less afflicted. http://flask.sagenb.org/home/pub/101/ If this fails, I'll attach the worksheet. On Sun, Mar 25, 2012 at 1:06 PM, Christian Stump wrote: >> balanced parentheses >> dyck paths >> coin stacks >> noncrossing m

Re: [sage-combinat-devel] Catalan

2012-03-24 Thread Tom Boothby
I actually started a project like this a while back. I made a catalog which accepts generators and mappings, and constructs mappings between objects types you've connected. It does some plotting, too. One weird thing about it is that I use the labels from Richard Stanley's catalog of objects. b

Re: [sage-combinat-devel] Sage coding sprint in Orsay

2011-11-25 Thread Tom Boothby
I'm seriously interested in cythonizing generators. If there's funding, I'd be delighted to come and hack for a week. On Thu, Nov 24, 2011 at 8:08 AM, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > 2011/11/24 Florent Hivert : >> >>  I'm thinking about organizing a small one-week coding sp

Re: [sage-combinat-devel] Re: Ribbon graphs

2011-10-03 Thread Tom Boothby
Bruce, Please keep posting here; or at the very least, copy me on the conversation. I'm curious how your "ribbon graphs" differ from orientable maps. I implemented Graph.genus(), which enumerates "rotation systems" which represent a given graph embedded on an orientable surface. To me, a rotati

Re: [sage-combinat-devel] unrooted planar trees

2011-09-11 Thread Tom Boothby
A "plane tree" is a tree with an embedding into the plane. A "planar tree" is a tree which can be embedded in the plane. Every tree is planar, so this term is offensive and redundant. Please don't put "planar tree" anywhere in Sage. On Sun, Sep 11, 2011 at 5:37 AM, Vincent Delecroix <20100.dele

Re: [sage-combinat-devel] Re: [sage-devel] permutation groups

2011-04-08 Thread Tom Boothby
On Fri, Apr 8, 2011 at 10:27 AM, Jason B Hill wrote: > The only real exception I see to accessibility of the theory is in the > partition backtrack algorithms themselves. Those simply need to be > written in a language that is appropriate for consumption. As far as I > know, nobody has really don

Re: [sage-combinat-devel] finite complex reflection groups and matrices over the universal cyclotomic field

2011-04-07 Thread Tom Boothby
On Thu, Apr 7, 2011 at 4:37 PM, Christian Stump wrote: > - is there a Sage implementation of permutation groups, or only the > gap implementation (it takes very long to go through the elements of a > permutation group, even in small examples)? Christian, Robert Miller has been hard at work impl

[sage-combinat-devel] Quantum Graph Algebra

2011-03-11 Thread Tom Boothby
Hello all, I'm currently taking a course on graph limits, and we've recently been discussing the algebra of quantum graphs. Some of this stuff is too incredible not to implement, so I knocked something together, and I've been playing with it for the past few days. What I'm writing is pure Python

Re: [sage-combinat-devel] generalized partitions...

2011-03-10 Thread Tom Boothby
Weak compositions may have zeros; I think it'd be natural to call this a weak partition. On Thu, Mar 10, 2011 at 7:57 AM, Florent Hivert wrote: >      Hi there, > > I'm currently playing with a slight generalization of the notion of > partition. They correspond to Ferrer's diagram with possible e

Re: [sage-combinat-devel] Where to find applications of "exact cover" ?

2010-08-30 Thread Tom Boothby
Here are a few problems I've solved with exact cover: 2D knapsack problem: http://sagenb.org/home/pub/2365/ graph coloring: http://hg.sagemath.org/sage-main/file/5b338f2e484f/sage/graphs/graph_coloring.py#l1 finding matchings in graphs finding cycle coverings of graphs finding short programs to co

[sage-combinat-devel] Request for Comments (graph genus)

2010-04-29 Thread Tom Boothby
I've been working on a new implementation of an algorithm to compute the genus of graphs. Throughout the process, I've been bound by the chains of backwards compatibility. As I've attempted to finish off the patch, I've found some deeply unsettling details in the current implementation. I'd like

Re: [sage-combinat-devel] enumerating permutations

2010-04-28 Thread Tom Boothby
Nicolas (et al), Thanks for your comments! Unfortunately, you replied minutes after I put up a new patch. The class (which I named PermutationEnumerator because nobody else had piped up) is purely for reference, and I don't actually see any other benefit to including it: it duplicates functional

Re: [sage-combinat-devel] enumerating permutations

2010-04-15 Thread Tom Boothby
> I must confess that I wasn't really convinced by my suggestion of using ... Again, I don't like this > name but I'm arguing that I even more dislike plain_changer. Fair enough, and well argued. I believe Knuth uses the term "plain change" because of the historic motivation -- I find the traditi

Re: [sage-combinat-devel] enumerating permutations

2010-04-15 Thread Tom Boothby
> I've seen it and started to comment. The main concern I have is the > name. Please see my comments there. Great. I rather disagree with your suggestion, but am open to persuasion. What do you suggest I call it? Knuth does attribute the algorithm to Trotter... but the name Steinhaus-Johnson-Tr

Re: [sage-combinat-devel] enumerating permutations

2010-04-15 Thread Tom Boothby
> It definitely should be in sage.combinat.permutations. I am not sure > where exactly though. Maybe just as a non exported function like > >        def cyclic_permutation_iterator(n) > > for the moment, and we will see later how and where to wrap and > advertise it depending on other applications.

[sage-combinat-devel] enumerating permutations

2010-04-13 Thread Tom Boothby
I just re-implemented an algorithm to compute a graph's genus in Cython to replace the Python version we've got. The algorithm involves iterating over all cyclic permutations of a finite set. Due to other details of the algorithm, there's a huge benefit to be gained by enumerating the cyclic perm