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: sage-feature
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 porton)

I have implemented binary relations (including composition of relations, set theoretic operations, conversion back/forth to graphs and to posets, etc.)

Attachments (1)

relations.patch (11.9 KB) - added by porton 2 years ago.
Patch for Sage "develop" branch

Download all attachments as: .zip

Change History (16)

Changed 2 years ago by porton

Patch for Sage "develop" branch

comment:1 Changed 2 years ago by porton

  • Branch develop deleted
  • Commit a1782046e2b38388649678926edf093edad867f8 deleted

comment:2 Changed 2 years ago by porton

  • Branch set to public/relations

comment:3 Changed 2 years ago by porton

  • Branch changed from public/relations to develop
  • Commit set to a1782046e2b38388649678926edf093edad867f8

comment:4 Changed 2 years ago by porton

  • Branch changed from develop to public/relations
  • Commit a1782046e2b38388649678926edf093edad867f8 deleted

comment:5 Changed 2 years ago by git

  • Commit set to bdf75491bc8944111a8c2b6f66d589f4253b59d0

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

0ff39aeto_graph() -> to_digraph()
fc900dcmethods made properties
73e5c98transitive_closure
ef76125removed a @property
72628f5binary relations to/from (di)graphs
f5a9be2(pre)order tests
bcd24cdTODO comment
43d743aadded cartesian product and identity relation
7714732integration of posets with binary relations
bdf7549doc comments changes

comment:6 Changed 2 years ago by porton

  • Authors set to Victor Porton
  • Description modified (diff)

comment:7 Changed 2 years ago by porton

  • Status changed from new to needs_review

comment:8 Changed 2 years ago by kcrisman

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 git

  • Commit changed from bdf75491bc8944111a8c2b6f66d589f4253b59d0 to 5fc5429bdbc56937b8b5839f40e4b0ee4ff93dc1

Branch pushed to git repo; I updated commit sha1. New commits:

5fc5429added FiniteBinaryRelation.{image,reverse_image}

comment:10 Changed 2 years ago by git

  • Commit changed from 5fc5429bdbc56937b8b5839f40e4b0ee4ff93dc1 to aa1564c771854f43d4c5dc4a0fbab97ffb448c03

Branch pushed to git repo; I updated commit sha1. New commits:

aa1564cadded FiniteBinaryRelation.enumerate_all()

comment:11 follow-up: Changed 2 years ago by embray

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 top-level 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 porton

@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 slelievre

There is interest for this, see

comment:14 in reply to: ↑ 11 Changed 16 months ago by klee

Replying to embray:

I suspect there's also probably a better place to put this than starting a new top-level package.

I agree. A top-level 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 klee

  • Status changed from needs_review to needs_work
Note: See TracTickets for help on using tickets.