# New package \`Posets\`

**URL:** <https://discourse.julialang.org/t/new-package-posets/117981>\
**Category:** Package Announcements\
**Tags:** combinatorics, graph-theory, discrete-mathematics\
**Created:** [August 8, 2024, 11:17pm UTC](https://discourse.julialang.org/t/new-package-posets/117981 "2024-08-08T23:17:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![scheinerman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scheinerman/32/35303_2.png) [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Post date:** [August 8, 2024, 11:17pm UTC](https://discourse.julialang.org/t/new-package-posets/117981/1 "2024-08-08T23:17:15Z")

</div>

Announcing a new package for working with partially ordered sets: `Posets`.

This package is based on Julia `Graphs` both in terms of dependency and design philosophy.

`Posets` is available now in the Julia registry and more information can be found on its [github pages](https://github.com/scheinerman/Posets.jl).

---

<div class="post-metadata">

**Author:** ![slwu89](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/slwu89/32/217323_2.png) [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Post date:** [August 9, 2024, 12:11am UTC](https://discourse.julialang.org/t/new-package-posets/117981/2 "2024-08-09T00:11:50Z")

</div>

Really great to see such a user friendly tool for posets. For current users of SimplePosets.jl, should we upgrade to this package? What’s the relationship between these two packages.

---

<div class="post-metadata">

**Author:** ![scheinerman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scheinerman/32/35303_2.png) [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Post date:** [August 9, 2024, 11:20am UTC](https://discourse.julialang.org/t/new-package-posets/117981/3 "2024-08-09T11:20:23Z")

</div>

Thanks @slwu88 !

There’s a significant design difference between `Graphs` vs `SimpleGraphs` that is replicated in `Posets` vs `SimplePosets`. In `Graphs`, the vertex set is always of the form `{1,2,...,n}` whereas in `SimpleGraphs`, the vertices can be lots of different types and, even if integers, can be arbitrary sets of integers.

There’s a whole team of people supporting the `Graphs` package and its ecosystem. I thought it reasonable then to have a posets package that plays nicely with `Graphs`, hence `Posets`. I also suspect that there a lot more users of `Graphs` than `SimpleGraphs` because of the well developed ecosystem for `Graphs`.

To answer your question “…should we upgrade to this package?” I’m not sure. The `Graphs` package was designed to be performant, so if you’re dealing with large graphs/posets, it might be better. But there’s no “upgrade” path per se.

What I should (will!?) do is make a tool to convert between `SimplePoset` type and `Poset` type like I did in [SimpleGraphConverters](https://github.com/scheinerman/SimpleGraphConverter.jl). I think I’ll put that code in the `extras` folder in the `Poset` repository.

Also: I’ve got `Posets` to a reasonable state, but I’m sure there will be more to be done. That’s where I’m likely to put my efforts.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![caleb-allen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/caleb-allen/32/14054_2.png) [@caleb-allen](https://discourse.julialang.org/u/caleb-allen)\
**Post date:** [August 9, 2024, 2:01pm UTC](https://discourse.julialang.org/t/new-package-posets/117981/4 "2024-08-09T14:01:01Z")

</div>

This is wonderful to see, I especially appreciate the very thorough documentation. Thank you for the package!

---

<div class="post-metadata">

**Author:** ![scheinerman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scheinerman/32/35303_2.png) [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Post date:** [August 9, 2024, 2:17pm UTC](https://discourse.julialang.org/t/new-package-posets/117981/5 "2024-08-09T14:17:59Z")

</div>

Thanks @caleb-allen !

---

<div class="post-metadata">

**Author:** ![caleb-allen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/caleb-allen/32/14054_2.png) [@caleb-allen](https://discourse.julialang.org/u/caleb-allen)\
**Post date:** [August 9, 2024, 3:04pm UTC](https://discourse.julialang.org/t/new-package-posets/117981/6 "2024-08-09T15:04:17Z")

</div>

The work I’ve been involved with uses posets as a centerpiece, but it’s all manually constructed with Arrays. It’s pretty terse code that doesn’t generalize well, and also doesn’t have any structural guarantees that the elements form a partial order.

I am looking forward to refactoring some of it on top of `Posets`, I imagine it will be significantly more intuitive, and more importantly safer by disallowing relation violations. Not to mention the wonderful toolkit of poset operations that are implemented.

I hadn’t encountered SimplePosets before, I’ll investigate that as well.

> [@scheinerman](#):
>
> There’s a significant design difference between `Graphs` vs `SimpleGraphs` that is replicated in `Posets` vs `SimplePosets`. In `Graphs`, the vertex set is always of the form `{1,2,...,n}` whereas in `SimpleGraphs`, the vertices can be lots of different types and, even if integers, can be arbitrary sets of integers.

For somebody coming into it fresh (not from the `Graphs` ecosystem), do you recommend one of `Posets` or `SimplePosets` over the other for a pretty extensive poset problem? My guess here is that `SimplePosets`, like `SimpleGraphs`, is a standalone, featureful implementation, and that `Posets`, like `Graphs`, is implemented with the goal of being the interface on which other packages are built. Is that fair to say?

---

<div class="post-metadata">

**Author:** ![Jean\_Michel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jean_michel/32/8282_2.png) [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Post date:** [August 9, 2024, 3:39pm UTC](https://discourse.julialang.org/t/new-package-posets/117981/7 "2024-08-09T15:39:04Z")

</div>

There is also the package [FinitePosets](https://github.com/jmichel7/FinitePosets.jl)

---

<div class="post-metadata">

**Author:** ![slwu89](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/slwu89/32/217323_2.png) [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Post date:** [August 9, 2024, 3:50pm UTC](https://discourse.julialang.org/t/new-package-posets/117981/8 "2024-08-09T15:50:52Z")

</div>

Thanks for the clarification on the design of the two packages @scheinerman! I think that it makes sense for me to “upgrade” to using Posets.jl, it looks like the cost of moving is not large and especially if that is where more future development will be, I would like to be able to take advantage of the most up to date features, so to speak.

---

<div class="post-metadata">

**Author:** ![scheinerman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scheinerman/32/35303_2.png) [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Post date:** [August 9, 2024, 4:33pm UTC](https://discourse.julialang.org/t/new-package-posets/117981/9 "2024-08-09T16:33:27Z")

</div>

Yes. `SimplePosets` doesn’t connect to a larger community, so I started afresh to make `Posets` in order to be in close alignment with [JuliaGraphs](https://juliagraphs.org/). #Graphs

Any further development in `Graphs` will benefit `Posets`.

I’m open to suggestions about how to improve `Posets`. Thanks for the interest!
