First, off I am a bloody beginner when it comes to programming in general and Mathematica in particular. I only started using it so I can make sense of my suggestions for the semantics in my syntax thesis ( I am a generativist linguist). Please be gentle. I have the following problem: I would like to visualize the subset relation of a given Set e.g.
A = {{{M1, W2}, {M1, W3}, {M1, W4}, {M2, W1}, {M2, W2}, {M2, W3}, {M2, W4},
{M3, W1}, {M3, W2}, {M3, W3}, {M3, W4}, {M4, W1}, {M4, W2}, {M4, W3}, {M4, W4},
{M1,M2,M3,W1,W2,W3}, {M1,M2,M3,M4,W1,W2,W3,W4}}}
Now I have found this code here:
ClearAll[hasseF]
hasseF = TransitiveReductionGraph@*RelationGraph
hasseF[SubsetQ, Subsets[{{M1, W1}, {M1, W2}, {M2, W1}, {M2, W2}}],
VertexShapeFunction -> "Name"]
However, I have four issues with this:
It displays the sets as matrices (?), not as sets. I would like them to be displayed as sets
The arrows should either go into the opposite direction or there shouldn't be any arrow tips at all (which I would prefer honestly).
The whole thing looks a bit crooked. Is there any way to make it look more symmetrical?
The only way to feed it sets is via the subsets function, however the set I posted in the introduction is a subset of a powerset.
Thanks in advance,
Nicolas
TransitiveReductionGraph
is still buggy as of Mathematica 12.0 (but I'm very optimistic about a fix in 12.1). The graph you construct withRelationGraph
has vertices that are lists. Of course, such as graph is extremely useful. But unfortunately, several built-in functions (includingSubgraph
) will mishandle such graphs. Thus it's somewhat dangerous to use them. $\endgroup$