#14732 closed enhancement (fixed)
Realize a poset as a graph
Reported by: | chrisjamesberg | Owned by: | sage-combinat |
---|---|---|---|
Priority: | major | Milestone: | sage-5.11 |
Component: | combinatorics | Keywords: | FindStatDays01 |
Cc: | tscrim, VivianePons, stumpc5 | Merged in: | sage-5.11.beta2 |
Authors: | Chris Berg | Reviewers: | Travis Scrimshaw, Christian Stump |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
This implements a method on posets which returns the graph obtained by forgetting the orientation of the Hasse diagram.
Attachments (2)
Change History (17)
comment:1 Changed 6 years ago by
- Keywords FindStatDays 01 added
- Status changed from new to needs_review
comment:2 Changed 6 years ago by
- Keywords FindStatDays01 added; FindStatDays 01 removed
comment:3 Changed 6 years ago by
- Reviewers set to Travis Scrimshaw
- Status changed from needs_review to positive_review
comment:4 Changed 6 years ago by
The description could be more specific. Maybe something like "The graph obtained by forgetting the orientation of the Hasse diagram"?
Is there a strong use case (e.g. for findstat) for this feature to make it deserve a method of its own? I mean Graph(P.hasse_diagram())
is pretty explicity and short.
comment:5 follow-up: ↓ 10 Changed 6 years ago by
Hi Nicolas,
actually there is a strong use case: in FindStat? we need the method to consider the map between posets and graphs. When people look for a stat on posets, this maps allows us to also look on graphs.
From a pure Sage point of vue, I think it is actually a nice shortcut: not everyone thinks of transforming the poset into a Hasse diagram.
comment:6 Changed 6 years ago by
- Description modified (diff)
Changed 6 years ago by
comment:7 Changed 6 years ago by
- Status changed from positive_review to needs_work
Need to make the returned graph hashable.
Changed 6 years ago by
comment:8 Changed 6 years ago by
- Status changed from needs_work to needs_review
comment:9 Changed 6 years ago by
- Reviewers changed from Travis Scrimshaw to Travis Scrimshaw, Christian Stump
- Status changed from needs_review to positive_review
The review patch looks good to me! (The patchbot complain doesn't seem to be related to the patch.)
comment:10 in reply to: ↑ 5 ; follow-up: ↓ 11 Changed 6 years ago by
Grumble, my comment never made it through. Well, it's kind of late now, but since I had typed it in ....
Replying to VivianePons:
actually there is a strong use case: in FindStat? we need the method to consider the map between posets and graphs. When people look for a stat on posets, this maps allows us to also look on graphs.
From a pure Sage point of vue, I think it is actually a nice shortcut: not everyone thinks of transforming the poset into a Hasse diagram.
I would find more natural to have hasse_diagram be a combinatorial map from posets to directed graphs (possibly with an alias to_digraph, or just digraph for consistency with crystals). And to have another combinatorial map from directed graphs to graphs. The composition of the two maps is not super canonical.
Have fun at Findstat Days 1!
comment:11 in reply to: ↑ 10 Changed 6 years ago by
comment:12 Changed 6 years ago by
- Merged in set to sage-5.11.beta2
- Resolution set to fixed
- Status changed from positive_review to closed
comment:13 Changed 6 years ago by
I would like to make here the same comment I made in #14734. This patch creates a function that replaces the sequence of characters Graph(P.hasse_diagram())
. It totally convinces me that this has NOTHING to do in Sage, and that the only reason that it is added is because of a third-party project.
It totally convinces me that you should find a non-intruding way to build your website, saving us the addition of the empty functions you need for your personal use.
Nathann
comment:14 follow-up: ↓ 15 Changed 6 years ago by
Hi Nathan
thank's for being so friendly.
Just to say, of course we did it because it is useful for Findstat (you can name it, it's not forbidden). But I don't see how it affects anything in anyway for users and how it is bad in anyway for Sage. I actually think it it makes it better, because I for example would never think of doing Graph(P.hasse_diagram()) to transform the Poset into a Graph. The fact that you know it because you usually work with this object doesn't mean everyone knows this.
comment:15 in reply to: ↑ 14 Changed 6 years ago by
Yo !
Just to say, of course we did it because it is useful for Findstat (you can name it, it's not forbidden).
I thought I named it several time, and I did not want to avoid it. I just wanted to make clear that find_stat is a project which is totally distinct from Sage, and so we have no reason to change our software for it.
But I don't see how it affects anything in anyway for users and how it is bad in anyway for Sage. I actually think it it makes it better, because I for example would never think of doing Graph(P.hasse_diagram()) to transform the Poset into a Graph.
.... Oh. Well, if this is really the problem you want to solve perhaps you could have tried to make this work instead :
sage: P = posets.RandomPoset(5,.1) sage: Graph(P)
Much more natural, don't you think ?
The fact that you know it because you usually work with this object doesn't mean everyone knows this.
That's not my point. "Make a Graph from a poset" means nothing in the first place, a poset is not a graph and several graphs would make sense. The Hasse Diagram istelf, or its undirected version, or the transitive closure, or the undirected version of it.
What I mean is that you really add a function there "because you want a function from Posets to Graphs, whatever it is".
Besides I just noticed that as I asked during the talk you gave, this combinatorial_map thing actually replaces each function it touches by a class. And so Sage computes stuff when a users runs code that are ONLY USEFUL for your f..... website.
That's bad work.
Nathann
Looks good. Thanks.