Lattice Drawing

POSSIBILISTIC INFORMATION:
A
Tutorial
Lattice
Drawing
Survey of Approaches, Geometric Method and Existing Software
George J. Klir
State University Jan
of Outrata
New York (SUNY)
Binghamton, New York 13902, USA
[email protected]
Palacky University, Olomouc, Czech Republic
!
prepared for International Centre for Information and Uncertainty, Palacky University, Olomouc
!
!
Jan Outrata (DAMOL)
!
Lattice Drawing
March 2012
1 / 40
Outline
1
2
3
4
introduction and motivation to drawing lattices
existing approaches and methods
drawing by hand
layer approach and force directed approach
new approaches for lattices
level method (my own)
nested diagrams
geometric heuristic
geometric method: intro
rules of parallelograms and lines
evaluation & comparison
open questions and problems
our research
software for drawing lattices
existing software
our software: LatVis, EllenaArt and JLatVis
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
2 / 40
Introduction and motivation
– important role of lattices in computer science and applied math. (data
analysis, information retrieval, machine learning, intelligent systems, industrial
engineering, . . . )
– information usually represented by hierarchical structures, often described by
graphs or lattices
– need to visualize (draw) lattices –
(commonly) by drawings of
Hasse (upward, linear) diagram
= oriented graph hV, Ei, where nodes V = lattice
elements and edges E = lattice cover relation ≺
+ drawing conventions:
1
node for x is drawn (as a dot or a circle) below node for y ⇐⇒ x < y
2
nodes for x and y are connected by a straight line ⇐⇒ x ≺ y (i.e. no lines for
transitive edges and no cycles)
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
3 / 40
Introduction and motivation (con’t)
Problem:
We can draw many different Hasse diagram drawings of (the Hasse diagram of) a
given lattice.
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
4 / 40
Introduction and motivation (con’t)
Problem:
We can draw many different Hasse diagram drawings of (the Hasse diagram of) a
given lattice.
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
4 / 40
Introduction and motivation (con’t)
Problem:
We can draw many different Hasse diagram drawings of (the Hasse diagram of) a
given lattice.
Task:
Arrange the nodes and lines of the lattice diagram drawing in order to achieve the
best visual quality, readability, etc. . . . and do it fast and automatically.
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
4 / 40
Lattice drawing
– evolved from graph drawing (well-elaborate)
– several subjective human aesthetics criteria: minimizing line crossings,
maximizing conflict distance, angle between incident lines, symmetries,
compactness, lucidity etc.
= optimization criteria used when drawing by hand, some are subjective
– however, what makes the best readable diagram?
– criteria are often contradictory and lead to computationaly difficult
(NP-hard/complete) problems
→ heuristic approaches to drawing, but still the task remains difficult (how to
precisely mathematize the criteria?)
= several automated drawing methods, but none universal, the best
– drawing by hand (traditionally) remains better, but it is slow and tedious
– automated drawing by computer can be at least a good starting point
Note: We also have common criteria for labelling diagram nodes (e.g. in concept lattices,
depends on application area): dots, circles, squares, empty, filled, multicolor, . . .
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
5 / 40
Lattice drawing (con’t)
How large lattices one can draw by a computer?
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
6 / 40
Lattice drawing (con’t)
How large lattices one can draw by a computer?
Up to about a hundred of elements.
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
6 / 40
Lattice drawing (con’t)
How large lattices one can draw by a computer?
Up to about a hundred of elements.
There is no point in drawing whole larger lattices.
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
6 / 40
Lattice drawing (con’t)
→ divide and draw substructures (only) or use e.g. focus+context drawing
techniques
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
7 / 40
Publications
J. Outrata: Drawing lattices with a geometric heuristic. In: Yager R. R., Sgurev V.
S., Jotsov V. S. (Eds.): Proc. IEEE CIS 2008, pp. 15-35-–15-41, IEEE, 2008.
J. Outrata, V. Vychodil: Algorithms for Lattice Drawing: A Comparative Survey. (in
preparation)
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
8 / 40
Existing approaches and methods
Presumptions:
drawing a lattice top-down, i.e. downwards from the top element
(usually) no need of initial drawing, the input is the underlying order relation only
Drawing by hand (“intuitively”)
= arranging nodes of lower neighbors of actual element followed by placing nodes
of infima of the neighbors or further neighbors and so on
problem: particular placement of nodes → “intuitively” in iterations
EXERCISE:
Draw the Hasse diagram of the following lattice:
elements:
lower neighbors:
a
Jan Outrata (DAMOL)
b
a
c
a
d
a
e
bc
f
bd
Lattice Drawing
g
cd
h
ef g
March 2012
9 / 40
Existing approaches and methods (con’t)
Drawing graphs
G. Di Battista, P. Eades, R. Tamassia, I.–G. Tollis:
Graph Drawing: Algorithms for the Visualisation of Graphs,
Prentice-Hall, New Jersey, 1999.
many elaborate methods
some can be used and adapted to draw Hasse diagrams
Layer approach
= nodes in layers based on their distance from the top node, sorted to achieve
minimal line crossings
steps:
1
2
3
layer assignment (determining y-coordinates): longest path layering,
Coffman-Graham layering, usage of “fake nodes” leading to broken lines
crossing reduction: layer-by-layer node sweep by solving two-layer crossing problem
(using sorting, averaging, linear programming methods etc.)
x-coordinate assignment: to achieve parallel lines, straightening broken lines
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
10 / 40
Existing approaches and methods (con’t)
Layer approach – example
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
11 / 40
Existing approaches and methods (con’t)
Force directed approach
= balancing imaginary repulsive and attractive forces between nodes (and lines),
based on spring models from physics
resulting drawing depends on initial arrangement of nodes
works in iterations, results are “unpredictable” (methods are quite difficult to
adapt to Hasse diagrams)
several variants: force placement, edge-edge repulsion and others
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
12 / 40
Existing approaches and methods (con’t)
New approaches for lattices
attribute additivity = node position p~(x) for element x from lattice V
determined by node positions p~(y) of greater inf-irreducible elements
y ∈ M (V ), e.g.
X
p~(x) := ~c +
p~(y)
y∈M (V ) | x≤y
combinations of methods, e.g. hybrid method = layer + attribute additivity
special methods, due to visualizing concept lattices in FCA, e.g. grid method
= projection of the lattice embedded into a multidimensional grid (after e.g.
chain decomposition) onto a suitable plane
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
13 / 40
Existing approaches and methods (con’t)
Level method (my own)
similar to drawing by hand and layer approach
solves the problem of particular placement of nodes by minimizing line crossings
and maximizing compactness of the diagram
= arranging nodes of lower neighbors of elements from previous level/layer in a
new level/layer, evenly below the elements’ nodes and ordered by
non-decreasing numbering computed by summing numbers of upper neighbors
0
0
1
2
1
2
3
6
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
14 / 40
Existing approaches and methods (con’t)
Present methods:
– produce quite good, readable, diagrams, however, for small lattices only
(around 30 elements at max) – because of global optimization?
– attribute additivity based win
– performance of drawing or interactive altering by e.g. moving of nodes is not a
problem (up to a hundred of elements)
Nested diagrams
= separated parts of the whole diagram drawn as nested diagrams, bunches of
parallel lines replaced by a single (or double) line
used by Wille et al. in FCA
interesting idea, well-readable drawings (even for tens of elements), but unusual
and not very used
problem: identifying parts – needs structural analysis of the lattice (hard!)
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
15 / 40
Existing approaches and methods (con’t)
Nested diagrams – example
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
16 / 40
Geometric method: intro
proposed by Wille et al. in 1989, re-introduced in 1993
R. Wille: Geometric representation of concept lattices. In: Opitz O. (Ed.):
Conceptual and numerical analysis of data, pp. 239–255, Springer-Verlag,
Berlin-Heidelberg, 1989.
G. Stumme, R. Wille: A geometric heuristic for drawing concept lattices. In:
Tamassia R., Tollis I. G. (Eds.): Graph drawing, pp. 85–98, Springer,
Berlin-Heidelberg-New York, 1993.
originally developed for drawing concept lattices in FCA
based on geometrical interpretations of parts of the diagram (drawing) to find
the best possible diagram drawing
– original description uses a so-called geometrical diagram – an auxiliary
intermediate picture when drawing by hand
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
17 / 40
Geometric method: intro (con’t)
Geometrical diagram
= a look at the 3D visualization of the lattice from its top element:
lower neighbor of top element → circled label
element with one upper neighbor → circled label partly covered by the neighbor’s
label
elements with two upper neighbors → circled label partly covered by a line
connecting the neighbors’ labels
elements with three upper neighbors → label inside a (sloped filled) triangle
connecting the neighbors’ labels
. . . (the top and the least element are omitted)
EXERCISE:
Draw the geometrical diagram for the following lattice:
elements:
1 2 3 4 5 6 7 8 9 10 11 12 13
14
15
16 17
18
upper neighbors:
1 2 1 2 4 3 5 1 7 2 7 9 3 9 4 7 8 12 5 9 12 10 14 6 11 14 6 13 15 16 17
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
18 / 40
Geometric method: intro (con’t)
Geometrical diagram – example (from exercise)
8
7
13
15
10
12
9
11
14
16
2
5
3
4
6
17
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
19 / 40
Geometric method: intro (con’t)
→ drawing of the Hasse diagram by discovering or recognizing and applying
geometrical patterns in parts of the diagram (drawing)
– using mainly two geometric rules:
1
2
rule of parallelograms
rule of lines
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
20 / 40
Rule of parallelograms
Definition (Rule of parallelograms)
A new node should be positioned in such a way that the node together with some
already positioned nodes and lines forms a parallelogram (the geometric shape with
parallel lines, e.g. diamond or rhomboid).
– rather general rule, looks simple, but
– immediate problem: vague formulation “some already positioned nodes”
→ most commonly selected nodes = of pair of upper neighbors + their
supremum
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
21 / 40
Rule of lines
Definition (Rule of lines)
A new node should be positioned on a prolonged line connecting some already
positioned nodes, preferably at the same distance as the distance between the nodes.
– again, rather general simply looking rule, but
– again, immediate problem: vague formulation “some already positioned nodes”
→ most commonly selected nodes = of an upper neighbor + its upper neighbor
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
22 / 40
Geometric method (con’t)
Application of rules
– results in many parallel lines and regular geometric shapes in the diagram
drawing (fulfilling aesthetics criteria) → good level of readability even for
medium sized lattices (30–50 elements)
= essential part of applying regular geometrical shapes, structures and patterns
– the aim: best possible overall geometric regularity of the diagram
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
23 / 40
Comparison of methods
hand drawn
Jan Outrata (DAMOL)
level
Lattice Drawing
layer
geometric
March 2012
24 / 40
Open questions and problems (1)
However, the application of rules is not a straightforward action at all – there are
many ambiguities leading to decisions in the new node positioning:
Rule of parallelograms
– there can be more than one pair of upper neighbors → the node of the
supremum of the chosen neighbors should be as close in the diagram drawing as
possible = make the parallelogram as small as possible
– ideally the supremum should be the
common upper neighbor of the upper
neighbors – if it is not, should we position
the new node in the middle bellow its
upper neighbors? (violating the rule,
typically used for the least element of the
lattice)
– other ambiguities . . .
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
25 / 40
Open questions and problems (2)
Rule of lines
– there can be more than one upper neighbor of the upper neighbor → ?
– should we position the new node straight bellow its upper neighbor? (violating
the rule)
– other ambiguities, e.g. more upper neighbors of the newly positioned node –
which of the rules to apply? . . .
The final choices in the decisions often
depend on suggested (not fixed) positions
for other elements.
↓
complex heuristic on (semi)local
optimization problems
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
26 / 40
Open questions and problems (3)
Arrangement of co-atoms (inf-irreducibles)
– important starting point in drawing the diagram!
– or whenever the rule of lines suggests the same location
→ we can place the nodes on an imaginary horizontal line, a parabola, using a force
directed approach, . . .
– which order of the elements? → should position the nodes of elements which
have more lower neighbors aside (since we will need some space for the
neighbors’ nodes)
– the same applies for nodes with equal suggested location (by the rules or any
other way)
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
27 / 40
Geometric method (con’t)
EXERCISE:
Draw the Hasse diagram for the lattice (and its geometrical diagram) from the
previous exercise.
8
7
elements:
1 2 3 4 5 6 7 8 9 10 11 12 13
upper neighbors:
1 2 1 2 4 3 5 1 7 2 7 9 3 9 4 7 8 12
elements:
14
15
16 17
18
upper neighbors: 5 9 12 10 14 6 11 14 6 13 15 16 17
13
15
10
12
9
11
14
16
2
5
3
4
6
17
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
28 / 40
Geometric method (con’t)
EXERCISE:
Draw the Hasse diagram for the lattice (and its geometrical diagram) from the
previous exercise.
1
elements:
1 2 3 4 5 6 7 8 9 10 11 12 13
upper neighbors:
1 2 1 2 4 3 5 1 7 2 7 9 3 9 4 7 8 12
elements:
14
15
16 17
18
upper neighbors: 5 9 12 10 14 6 11 14 6 13 15 16 17
17
2
4
7
3
5
9
12
6
11
14
10
8
15
13
16
18
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
28 / 40
Our research
– no further papers on the geometric method (since the initial two or three in
1989-93)!
– we find the method very promising
– we have explored (some of) the problems and proposed some ideas and solutions
→ we are developing a new method for automated lattice drawing inspired by
and further refining the geometric method
Main idea: (intermediate) logical diagram description
– (somehow) resemblant to the geometrical diagram from the original description
of geometric method, but more general
– contains: constraints of Hasse diagram, space constraints, node positions
suggested by the geometric rules and other principles, evaluations of the
suggested positions, . . .
– obtaining final diagram drawing = heuristic solutions to both local and global
optimization problems – aimed at producing the best possible drawing
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
29 / 40
Software for drawing lattices: requirements
→ best possible diagram drawing of a given lattice, implementing more methods
fine-tuning the diagram drawing by hand (or additional methods): moving
nodes or parts, grid aligning, hiding/folding parts, zooming, rotating, etc.
displaying parts of the lattice: lower/upper neighbors/cones, infs/sups,
mins/maxs, paths, etc.
exporting the diagram drawing (or part of it) to the picture in a paper, look
customization
editing the lattice (underlying order relation)
...
usable by end user (i.e. graphical)
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
30 / 40
Software for drawing lattices: concept lattice
Software for FCA (Formal Concept Analysis)
– original purpose: a tool for FCA
→ drawing the concept lattice (and yes, by Main Theorem of FCA any complete
lattice, but . . . )
Toscana, Anaconda, Diagram
FCA tools from the (former) FCA group of TU Darmstadt, Germany
not available anymore
ToscanaJ
Java reimplementation of Toscana, part of Tockit FCA framework
(http://tockit.sourceforge.net), open source, latest version 2006
drawing methods?, nested diagrams
viewing only, displaying lower/upper cones, exporting, look customization
http://toscanaj.sourceforge.net/
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
31 / 40
Software for drawing lattices: concept lattice (con’t)
Galicia
(rich) FCA platform, written in Java, open source, latest version 2005
layer and force directed approaches (including 3D variants)
node moving, zooming, rotating (in 3D), exporting
http://www.iro.umontreal.ca/~galicia/
Concept Explorer
(popular) FCA tool, written in Java, open source, latest version 2006
layer, force directed (including the one in LatDraw, see later) and grid approaches
node moving, grid aligning, zooming, displaying lower/upper cones, exporting
http://conexp.sourceforge.net/
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
32 / 40
Software for drawing lattices: concept lattice (con’t)
GaloisExplorer
FCA tool, written in C++ (MS Windows, Apple Mac OS), free software, latest
version 2009
force directed approach? (3D variant)
viewing only, other features?
http://galoisexplorer.sourceforge.net
JaLaBa
online FCA web form and Java applet
based on LatDraw for drawing the concept lattice, see next
http://maarten.janssenweb.net/jalaba/JaLaBA.pl
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
33 / 40
Software for drawing lattices: any lattice
Software for drawing (arbitrary finite) lattices
LatDraw
online Java applet or Java application by Ralph Freese from University of Hawaii
used by/basis for several other tools (e.g. JaLaBa, JavaScript Lattice Drawing,
see next, JavaMath plugin to Maple), source upon request (API for free)
combined layer and force directed approach
viewing only, rotating (in 3D)
http://www.math.hawaii.edu/~ralph/LatDraw/,
http://www.latdraw.org
JavaScript Lattice Drawing Program
online JavaScript application
based on LatDraw for drawing the lattice, combined with genetic algorithm
viewing only, zooming
http://www.cune.edu/facweb/john.snow/drawlat.html
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
34 / 40
Software for drawing lattices: any lattice (con’t)
Interactive Poset and Lattice Drawing Java Applet
online Java applet, open source
(simplified) combined layer and force directed approach
limited node moving
http://www1.chapman.edu/~jipsen/gap/posets.html
Conclusion
– some (5) FCA tools, quite limited in lattice drawing features
– just three very limited Java/JavaScript applications for drawing arbitrary (small
finite) lattices!
– quite a lot of (elaborate) graph drawing tools (http://www.graphviz.org
http://graphdrawing.org), but none of them with (explicit) lattice Hasse
diagram drawing feature
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
35 / 40
Software for drawing lattices: any lattice (con’t)
Interactive Poset and Lattice Drawing Java Applet
online Java applet, open source
(simplified) combined layer and force directed approach
limited node moving
http://www1.chapman.edu/~jipsen/gap/posets.html
Conclusion
– some (5) FCA tools, quite limited in lattice drawing features
– just three very limited Java/JavaScript applications for drawing arbitrary (small
finite) lattices!
– quite a lot of (elaborate) graph drawing tools (http://www.graphviz.org
http://graphdrawing.org), but none of them with (explicit) lattice Hasse
diagram drawing feature
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
35 / 40
Our software for drawing lattices
LatVis (Jan Outrata, 2003)
lattice and poset editor and visualizer, written in C++ (MS Windows,
GNU/Linux), free software (GNU GPL), latest version 2004
developed within MSc. thesis of Jan Outrata at Dept. Computer Science,
Palacký University, Czech Rep. in 2003
layer approach, (author’s own) level and (original) geometric methods
fine-tuning: node moving (selected, with coordinates displayed), node hiding
displaying and selecting parts: lower/upper neighbors/cones, infs/sups,
mins/maxs, paths
exporting: Metapost, Encapsulated Postscript (and PDF), look customization
editing (underlying order relation): copy&paste, undo/redo
http://phoenix.inf.upol.cz/~outrata/latvis/
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
36 / 40
Our software for drawing lattices (con’t)
EllenaArt (Lukas Hostalek, 2007)
lattice and poset drawing tool, written in Java, open source, latest version 2008
developed within MSc. thesis Lukas Hostalek at Dept. Computer Science,
Palacký University, Czech Rep. in 2007
force directed approach (three variants), (author’s own) heuristic and (original)
geometric methods
fine-tuning: node moving (selected, with coordinates displayed), grid aligning,
zooming
exporting: Encapsulated Postscript and PDF, look customization
http://phoenix.inf.upol.cz/~hostalel/en/ellenart/ellenart.html
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
37 / 40
Our software for drawing lattices (con’t)
JLatVis (Michal Kandr, 2011)
lattice and poset visualizer, successor of LatVis, written in Java, open source,
latest version 2011
developed within BSc. thesis of Michal Kandr at Dept. Computer Science,
Palacký University, Czech Rep. in 2011
uses LatVis’s methods for drawing the lattice (or poset), but can use any
drawing application
fine-tuning: node moving (selected, with coordinates displayed), grid and
parallelogram/line rule aligning, all visuals hiding, zooming, resizing
displaying and selecting parts (all visuals): lower/upper neighbors/cones,
infs/sups, mins/maxs, paths
searching: all visuals (nodes, labels, lines and notes), textual and visual
exporting: Metapost, PDF, SVG, PNG, JPG and other, rich look
customization
http://www.jlatvis.com
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
38 / 40
Thank you!
LatVis
EllenaArt
http://phoenix.inf.upol.cz/~outrata/latvis/
http://phoenix.inf.upol.cz/~hostalel/en/ellenart/ellenart.html
JLatVis http://www.jlatvis.com
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
39 / 40
Úkoly
Nakreslete co nejlépe vypadajı́cı́ Hasseův diagram následujı́cı́ch svazů pomocı́
1
atributově aditivnı́ metody.
2
geometrické metody; navrhněte vlastnı́ řešenı́ nejednoznačnostı́ v aplikaci pravidel
paralelogramů a čar.
3
vlastnı́ navržené metody; metoda by měla minimálně zvládnout nakreslit
boolovský svaz se třemi atomy jako běžné zobrazenı́ třı́rozměrné krychle.
Odevzdejte popis (pseudokód) algoritmu, jehož vstupem je zadánı́ svazu (relace
uspořádánı́) a výstupem seznam souřadnic pro všechny prvky svazu.
Svaz 1:
elements:
1 2 3 4 5 6
7
8
9 10 11
lower neighbors:
1 1 1 1 2 3 3 4 4 5 6 7 7 8 9 10
Svaz 2:
elements:
1 2 3 4 5
6
7 8 9 10 11 12
13
14
15
16
lower neighbors:
1 1 1 1 2 3 5 4 5 5 6 7 6 8 7 8 8 9 10 11 10 12 11 12 13 14 15
Jan Outrata (DAMOL)
Lattice Drawing
March 2012
40 / 40