digraphs / Digraphs

The GAP package Digraphs
https://digraphs.github.io/Digraphs
Other
29 stars 42 forks source link

Implement `IsPartialOrderCoveringDigraph` property and add `CoveringDigraph` versions for other properties #632

Open reiniscirpons opened 3 months ago

reiniscirpons commented 3 months ago

It would be useful to implement IsPartialOrderCoveringDigraph and IsLatticeCoveringDigraph properties which check that a given digraph is the covering relation (the reflexive transitive reduction) of some partial order or lattice respectively. In a similar vein, CoveringDigraph versions of any other order properties in Chapter 6.4 of the Digraphs documentation. See also issue #84 for a discussion of properties of lattices and some suggestions relating to covering relations.

The motivation behind this is that the IsPartialOrderDigraph and IsLatticeDigraph properties both require that the underlying digraph is transitive. This matches the mathematical definition, however the covering relation (transitive reflexive reduction) of a partial order or lattice often has dramatically less edges. By extension there are often more efficient algorithms to check if a given digraph is the covering relation of some partial order or lattice.

As an example, consider the full binary tree of height 14:

gap> T := BinaryTree(14);
<immutable digraph with 16383 vertices, 16382 edges>
gap> S := DigraphReflexiveTransitiveClosure(T);
<immutable preorder digraph with 16383 vertices, 212993 edges>

Note that T has an order of magnitude less edges than S. See also this stack exchange post on testing if a DAG is a lattice, the top answer discusses checking if the graph is the covering relation of a lattice for improving the time taken.

A further suggestion would be to implement versions of the properties which accept an arbitrary subrelation of a partial order or lattice. I.e. a digraph whose reflexive transitive closure is a partial order or lattice.