Skip to content

@Eckankar /hasse.nb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Generating Hasse diagrams in Mathematica
(* Combinatorica contains HasseDiagram,so we need to load it. *)
<<Combinatorica`;
(* The set the partial order operates on. *)
nums = {1, 2, 4, 7, 8, 14, 30};
(* Define our partial order. *)
pOrder[x_, y_] := Divisible[y, x];
(* Generate a directed graph from the partial order. *)
g = MakeGraph[nums, pOrder];
(* Now create our Hasse diagram *)
h = HasseDiagram[g];
(* Finally, let's see the resulting graph. *)
ShowGraph[h, VertexStyle -> PointSize[0.05], VertexLabel -> True,
VertexLabelColor -> White, VertexLabelPosition -> {0.012, 0}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.