Professional Documents
Culture Documents
37
38 CHAPTER 2. SPECTRAL GRAPH DRAWING
0.8
0.6
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8
A = [0 1 1 0 0; 1 0 1 1 1; 1 1 0 1 0;
0 1 1 0 1; 0 1 0 1 0];
D = diag(sum(A));
L = D - A;
[v, e] = eig(L);
gplot(A, v(:, [2 3]))
hold on
gplot(A, v(:, [2 3]),’o’)
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8
0.4
0.3
0.2
0.1
−0.1
−0.2
−0.3
−0.4
−0.5
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
The graph drawing on the right looks nicer than the graph
on the left but is is no longer planar.
0.9 0.5
0.8 0.4
0.7 0.3
0.6 0.2
0.5 0.1
0.4 0
0.3 −0.1
0.2 −0.2
0.1 −0.3
0 −0.4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4
Figure 2.4: Delaunay triangulation (left) and drawing of the graph from Example 4 (right).
2.2. EXAMPLES OF GRAPH DRAWINGS 51
0.25
0.2
0.15
0.1
0.05
−0.05
−0.1
−0.15
−0.2
−0.25
−0.25 −0.2 −0.15 −0.1 −0.05 0 0.05 0.1 0.15 0.2 0.25
0.25
0.2
0.15
0.1
0.05
−0.05
−0.1
−0.15
−0.2
−0.25
0.4
0.2
0
0.3
0.1 0.2
−0.2 0
−0.2 −0.1
−0.4 −0.4 −0.3