i1 : G = graph {{1,2}, {2,3}, {3,4}, {1,4}};
|
i2 : transitiveOrientation G
o2 = Poset{cache => CacheTable{} }
GroundSet => {1, 4, 2, 3}
RelationMatrix => | 1 1 1 0 |
| 0 1 0 0 |
| 0 0 1 0 |
| 0 1 1 1 |
Relations => {{1, 4}, {1, 2}, {3, 4}, {3, 2}}
o2 : Poset
|
i3 : setRandomSeed 0; |
i4 : G = graph {{1,2},{2,3},{3,4},{1,3},{1,3}};
|
i5 : removeIsomorphicPosets apply(4, i -> transitiveOrientation(G, Random => true))
o5 = {Poset{cache => CacheTable{...1...} },
GroundSet => {3, 1, 2, 4}
RelationMatrix => | 1 1 1 1 |
| 0 1 0 0 |
| 0 1 1 0 |
| 0 0 0 1 |
Relations => {{3, 1}, {3, 2}, {2, 1}, {3, 4}}
------------------------------------------------------------------------
Poset{cache => CacheTable{...1...} }}
GroundSet => {2, 3, 4, 1}
RelationMatrix => | 1 1 0 1 |
| 0 1 0 0 |
| 0 1 1 0 |
| 0 1 0 1 |
Relations => {{2, 3}, {4, 3}, {2, 1}, {1, 3}}
o5 : List
|
If the give graph is not a comparability graph, e.g. an odd cycle of length at least 5, then the method returns an error.