Opened 2 years ago
Last modified 15 months ago
#24542 needs_work enhancement
Binary relations in Sage implemented
Reported by:  porton  Owned by:  

Priority:  major  Milestone:  sagefeature 
Component:  packages: standard  Keywords:  
Cc:  Merged in:  
Authors:  Victor Porton  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  public/relations (Commits)  Commit:  aa1564c771854f43d4c5dc4a0fbab97ffb448c03 
Dependencies:  Stopgaps: 
Description (last modified by )
I have implemented binary relations (including composition of relations, set theoretic operations, conversion back/forth to graphs and to posets, etc.)
Attachments (1)
Change History (16)
Changed 2 years ago by
comment:1 Changed 2 years ago by
 Branch develop deleted
 Commit a1782046e2b38388649678926edf093edad867f8 deleted
comment:2 Changed 2 years ago by
 Branch set to public/relations
comment:3 Changed 2 years ago by
 Branch changed from public/relations to develop
 Commit set to a1782046e2b38388649678926edf093edad867f8
comment:4 Changed 2 years ago by
 Branch changed from develop to public/relations
 Commit a1782046e2b38388649678926edf093edad867f8 deleted
comment:5 Changed 2 years ago by
 Commit set to bdf75491bc8944111a8c2b6f66d589f4253b59d0
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
0ff39ae  to_graph() > to_digraph()

fc900dc  methods made properties

73e5c98  transitive_closure

ef76125  removed a @property

72628f5  binary relations to/from (di)graphs

f5a9be2  (pre)order tests

bcd24cd  TODO comment

43d743a  added cartesian product and identity relation

7714732  integration of posets with binary relations

bdf7549  doc comments changes

comment:6 Changed 2 years ago by
 Description modified (diff)
comment:7 Changed 2 years ago by
 Status changed from new to needs_review
comment:8 Changed 2 years ago by
This could be quite useful. It looks like you need quite a bit of documentation/examples for the many methods involved. Especially the back/forth with posets, if robust, would be great  see e.g. this stack overflow question.
comment:9 Changed 2 years ago by
 Commit changed from bdf75491bc8944111a8c2b6f66d589f4253b59d0 to 5fc5429bdbc56937b8b5839f40e4b0ee4ff93dc1
Branch pushed to git repo; I updated commit sha1. New commits:
5fc5429  added FiniteBinaryRelation.{image,reverse_image }

comment:10 Changed 2 years ago by
 Commit changed from 5fc5429bdbc56937b8b5839f40e4b0ee4ff93dc1 to aa1564c771854f43d4c5dc4a0fbab97ffb448c03
Branch pushed to git repo; I updated commit sha1. New commits:
aa1564c  added FiniteBinaryRelation.enumerate_all()

comment:11 followup: ↓ 14 Changed 2 years ago by
I'm surprised something like this isn't already in Sage though that's not something I'm really qualified to comment on. I suspect there's also probably a better place to put this than starting a new toplevel package.
I can make some minor nitpicks on the code itself if you think that would be helpful.
comment:12 Changed 2 years ago by
@embray I don't know if your nitpicks are good. After all, I know nothing about you. You decide if you do the work.
I am going to add yet one feature: Converting a function into a binary relation. However I will be busy today. I have not yet dived into details of this feature.
comment:13 Changed 17 months ago by
There is interest for this, see
comment:14 in reply to: ↑ 11 Changed 16 months ago by
Replying to embray:
I suspect there's also probably a better place to put this than starting a new toplevel package.
I agree. A toplevel package is supposed to contain many modules and/or packages.
I suggest to put this module into sage.combinat.relations
.
On the other hand, sage.sets.relations
would be a bad choice as sage.sets
is concerned with generic sets.
comment:15 Changed 15 months ago by
 Status changed from needs_review to needs_work
Patch for Sage "develop" branch