Questions tagged [poset]

POSet in a shorthand for Partially Ordered Set, that is a Set with a Partial Order.

A partial order is a binary relation ≤ over a set P which is reflexive, antisymmetric, and transitive, i.e., which satisfies for all a, b, and c in P:

  • a ≤ a (reflexivity);
  • if a ≤ b and b ≤ a then a = b (antisymmetry);
  • if a ≤ b and b ≤ c then a ≤ c (transitivity).

A POSet is just a set with a partial order.

28 questions
17
votes
1 answer

Products and coproducts in posets

While reading Bartosz' excellent Category theory for Programmers, I got stuck in the second exercise, which deals with products in posets. Given a poset, b e ↗ ⤭ ↘ a → c f → h ↘ ⤭ ↗ d g how can I define a product in the…
ThreeFx
  • 7,250
  • 1
  • 27
  • 51
16
votes
5 answers

Efficient algorithm to find the maximal elements of a partially ordered set

I have a partially ordered set, say A = [x1, x2, ...], meaning that for each xi and xj in the set, (exactly) one of four possibilities is true: xi < xj, xi == xj, xi > xj, or xi and xj are incomparable. I want to find the maximal elements (i.e.,…
asmeurer
  • 86,894
  • 26
  • 169
  • 240
14
votes
2 answers

Java partially ordered Collection

I am looking for a Java implementation of a data structure which holds a collection of elements for which a partial ordering is defined, and which allows one to iterate over those elements in some topological order (any of the possible orderings is…
JimN
  • 3,120
  • 22
  • 35
11
votes
3 answers

Sorting a poset?

There are a huge number of sorting algorithms out there, but most of them only work on totally-ordered sets because they assume that any two elements are comparable. However, are there any good algorithms out there for sorting posets, where some…
templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
10
votes
2 answers

How to sort a list using partial order in Haskell?

I have a procedural EDSL which uses blocks of statements. These statements are added to the blocks in no particular order although there may be dependencies between statements. During compilation of the EDSL, however, I need to make sure that the…
roldugin
  • 922
  • 5
  • 19
9
votes
1 answer

Enumerate all partial orders

How to efficiently enumerate all partial orders on a finite set? I want to check whether a partial order with specified properties exists. To check this I am going with brute force to enumerate all possible partial orders on small finite sets.
porton
  • 5,214
  • 11
  • 47
  • 95
8
votes
4 answers

Merging some sorted lists with unknown order sequence

I've some lists with variable number of elements. Each list is sorted, but the sorting algorithm is not known. I would like to merge the lists into one big list which contains all lists in same order, without duplicates. Example…
Gabriel
  • 127
  • 8
5
votes
1 answer

Algorithm to Compute Maximal Points in Pointset

I had this as the final question on an algorithms final (now completed): Given a set of (x,y) points P, let M(P) be the set of maximal points given the following partial ordering on P: (x,y) < (x',y') if and only if x < x' and y <…
jacobhaven
  • 383
  • 3
  • 9
5
votes
2 answers

Efficient incremental implementation of poset

I'm implementing in terms of SQLAlchemy a structure that has the mathematical characteristic of Partially Ordered Set, in which I need to be able to add and remove edges one at a time. In my current, best design, I use two adjacency lists, one being…
SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304
5
votes
1 answer

Selecting k sub-posets

I ran into the following algorithmic problem while experimenting with classification algorithms. Elements are classified into a polyhierarchy, what I understand to be a poset with a single root. I have to solve the following problem, which looks a…
dareios
  • 1,389
  • 2
  • 11
  • 10
4
votes
0 answers

What is the most optimal data structure for storing a partially-ordered set (poset)?

I am looking for a data structure for storing a poset, that supports the following operations with good big-Oh complexity (these are done frequently): determining if a given element can be consistently ordered before another one (top priority above…
WhyNott
  • 43
  • 2
4
votes
1 answer

Finding maximal elements of a poset's subset

The problem is the following: Given a poset's subset S find the maximal elements of S. For example consider the hass diagram of the poset in http://ndp.jct.ac.il/tutorials/Discrete/node34.html. Given a subset of it ex: {12, 2, 8} the maximal…
Alex
  • 207
  • 1
  • 2
  • 15
3
votes
1 answer

How to define arbitrary partial order relation and prove its properties?

I have a simple data type with all nullary constructors and wish to define a partial order for it, including a Relation.Binary.IsPartialOrder _≡_. My use case: the type is the type of sorts in an abstract syntax tree (statement, expression, literal,…
M Farkas-Dyck
  • 646
  • 4
  • 14
3
votes
1 answer

Anti-chain in a partially ordered set (DAG)

Can anyone tell if there exists a P-time algorithm for finding a anti-chain of size k in a partially ordered set? (or a DAG) All resources I found online deal with finding the maximum anti-chain.
2
votes
0 answers

Number of ways to go through a partially ordered set

This is built upon a previous question Solve a simple packing combination with dependencies, although there is no need to check out that question to understand this one. This question asks about the fastest ways to count the number of linear…
Susie
  • 287
  • 1
  • 13
1
2