Introduction to Graph Drawing
 
     
   | Graph Theory Notations | Selecting the Appropriate Graph Drawing Function | 
| Input Formats | References | 
| Graph Drawing Algorithms | 
| GraphPlot | generate a plot of a graph | 
| GraphPlot3D | generate a 3D plot of a graph | 
| LayeredGraphPlot | generate a layered plot of a graph | 
| TreePlot | generate a tree plot of a graph | 
 consists of a set of vertices
 consists of a set of vertices  (also called nodes) and a set of edges
 (also called nodes) and a set of edges  . Two vertices
. Two vertices  and
 and form an edge of the graph if
 form an edge of the graph if  .
. implies that
 implies that  , then
, then  is an undirected graph. Otherwise it is a directed graph. The former can be drawn using line segments, while the latter can be drawn with arrows. In an undirected graph, it is often convenient to denote that an edge exists between
 is an undirected graph. Otherwise it is a directed graph. The former can be drawn using line segments, while the latter can be drawn with arrows. In an undirected graph, it is often convenient to denote that an edge exists between  and
 and  with the notation
 with the notation  .
. be a directed graph. Assuming that the vertices are indices from
 be a directed graph. Assuming that the vertices are indices from  to
 to  , that is,
, that is,  , then the adjacency matrix of
, then the adjacency matrix of  is an
 is an  ×
× matrix, with entries
 matrix, with entries  if
 if  and
 and  otherwise.
 otherwise. if
 if  and
 and  otherwise.
 otherwise.Spring Embedding
 and
 and  are the coordinate vectors of nodes
 are the coordinate vectors of nodes  and
 and  , and
, and  is the Euclidean distance between them.
 is the Euclidean distance between them.  is the natural length of the spring between vertex
 is the natural length of the spring between vertex  and vertex
 and vertex  , and can be chosen as the graph distance between
, and can be chosen as the graph distance between  and
 and  . The parameters
. The parameters  are the strength of the springs, where
are the strength of the springs, where  is a parameter representing the strength of the springs.
 is a parameter representing the strength of the springs.  is the number of vertices.
 is the number of vertices.  complexity, vertices that are far apart are ignored in the calculation of force and energy. See the method option "InferentialDistance" of GraphPlot and GraphPlot3D for more information.
 complexity, vertices that are far apart are ignored in the calculation of force and energy. See the method option "InferentialDistance" of GraphPlot and GraphPlot3D for more information.Spring-Electrical Embedding
 , is restricted to adjacent vertices and is proportional to the Euclidean distance between them, where
, is restricted to adjacent vertices and is proportional to the Euclidean distance between them, where  is related to the natural spring length. The electrical force,
 is related to the natural spring length. The electrical force,  , on the other hand, is global and is inversely proportional to the Euclidean distance between nodes
, on the other hand, is global and is inversely proportional to the Euclidean distance between nodes  and
 and  . Overall, the energy to be minimized is
. Overall, the energy to be minimized is  , where
, where is a constant that regulates the relative strength of the repulsive and attractive forces, and
 is a constant that regulates the relative strength of the repulsive and attractive forces, and  is the Euclidean distance between nodes
 is the Euclidean distance between nodes  and
 and  . For a graph of two vertices, the ideal Euclidean distance between the vertices is
. For a graph of two vertices, the ideal Euclidean distance between the vertices is  , which gives a total energy of zero.
, which gives a total energy of zero. .
. High-Dimensional Embedding Algorithm
 -dimensional coordinate system is created based on
-dimensional coordinate system is created based on  centers. The centers are a set of
 centers. The centers are a set of  vertices that are chosen to be as far apart as possible. The first vertex is selected at random, and then each of the remaining centers is chosen as the farthest vertex from the previously selected centers. In other words, if
 vertices that are chosen to be as far apart as possible. The first vertex is selected at random, and then each of the remaining centers is chosen as the farthest vertex from the previously selected centers. In other words, if  centers have been selected,
 centers have been selected,  is the vertex whose shortest graph distance to the
 is the vertex whose shortest graph distance to the  centers is larger than or equal to the shortest graph distance of all the other vertices to the
 centers is larger than or equal to the shortest graph distance of all the other vertices to the  centers.
 centers.  centers, a
 centers, a  -dimensional coordinate system can be established. Each vertex
-dimensional coordinate system can be established. Each vertex  has the coordinates
 has the coordinates  , where
, where  is the graph distance between the vertex
 is the graph distance between the vertex  and the center
 and the center  . The
. The  -dimensional coordinate vectors form an
-dimensional coordinate vectors form an  ×
× matrix
 matrix  , where
, where  is the
 is the  th row of
 th row of  .
. -dimensional coordinates are projected back to two or three dimensions by a suitable linear combination. Assume that the graph with
-dimensional coordinates are projected back to two or three dimensions by a suitable linear combination. Assume that the graph with  coordinates and
 coordinates and  centers is projected back to two dimensions. In order to make this projection shift-invariant,
 centers is projected back to two dimensions. In order to make this projection shift-invariant,  is first normalized to
 is first normalized to  .
. and
 and  be two such
 be two such  -dimensional vectors. They should be uncorrelated, so they must be orthogonal to each other.
-dimensional vectors. They should be uncorrelated, so they must be orthogonal to each other. and
 and  to be the two eigenvectors that correspond to the first two largest eigenvalues of the
 to be the two eigenvectors that correspond to the first two largest eigenvalues of the  ×
× symmetric matrix
 symmetric matrix  . This process of choosing two highly uncorrelated vectors is also known as principal component analysis.
. This process of choosing two highly uncorrelated vectors is also known as principal component analysis. and
 and 
A Hierarchical Drawing Algorithm for Directed Graphs
1.  Vertices of the DAG are first assigned a preliminary  ranking such that if there is an edge from
 ranking such that if there is an edge from  to
 to  , then it is likely that
, then it is likely that  . This is to ensure that the final drawing has directed edges pointing mostly downward.
. This is to ensure that the final drawing has directed edges pointing mostly downward.
2.  The  coordinates are generated so that if there is an edge from
 coordinates are generated so that if there is an edge from  to
 to  and
 and  , their
, their  coordinates are as close as possible, but separated by a set minimum. This ensures that the final resulting drawing does not have many long edges. This process assigns the vertices into a finite number of layers. If an edge lies across a number of layers, virtual vertices are added.
 coordinates are as close as possible, but separated by a set minimum. This ensures that the final resulting drawing does not have many long edges. This process assigns the vertices into a finite number of layers. If an edge lies across a number of layers, virtual vertices are added.
3.  A preliminary  ranking is assigned to each vertex to minimize the number of edge crossings.
 ranking is assigned to each vertex to minimize the number of edge crossings.
4.  The  coordinates are generated by minimizing
 coordinates are generated by minimizing  subject to the constraints that vertices on the same layer obey the
 subject to the constraints that vertices on the same layer obey the  ranking generated in step 3 and are separated by a set minimum.
 ranking generated in step 3 and are separated by a set minimum.
Algorithms for Drawing Trees
 coordinate, and the horizontally closest vertices of adjacent subtrees are of unit distance apart. The root is placed at the center of the
 coordinate, and the horizontally closest vertices of adjacent subtrees are of unit distance apart. The root is placed at the center of the  coordinates of its subtrees and its
 coordinates of its subtrees and its  coordinate is one unit above them. TreePlot function chooses between these two algorithms, depending on the second argument of this function.
 coordinate is one unit above them. TreePlot function chooses between these two algorithms, depending on the second argument of this function.[1] Di Battista, G., P. Eades, R. Tamassia, and I. G. Tollis. Graph Drawing: Algorithms for the Visualization of Graphs. Prentice Hall, 1999.
[2] Fruchterman, T. M. J. and E. M. Reingold. "Graph Drawing by Force-Directed Placement." Software—Practice and Experience 21, no. 11 (1991): 1129–1164.
[3] Eades, P. "A Heuristic for Graph Drawing." Congressus Numerantium 42 (1984): 149–160.
[4] Quinn, N. and M. Breuer. "A Force Directed Component Placement Procedure for Printed Circuit Boards." IEEE Trans. on Circuits and Systems 26, no. 6 (1979): 377–388.
[5] Kamada, T. and S. Kawai. "An Algorithm for Drawing General Undirected Graphs." Information Processing Letters 31 (1989): 7–15.
[6] Harel, D. and Y. Koren. "Graph Drawing by High-Dimensional Embedding." In Proceedings of 10th Int. Symp. Graph Drawing (GD'02), 207–219, 2002.
[7] Walshaw, C. "A Multilevel Algorithm for Force-Directed Graph-Drawing." J. Graph Algorithms Appl. 7, no. 3 (2003): 253–285.
[8] Cuthill, E. and J. McKee. "Reducing the Bandwidth of Sparse Symmetric Matrices." In Proceedings, 24th National Conference of ACM, 157–172, 1969.
[9] Lim, A., B. Rodrigues, and F. Xiao. "A Centroid-Based Approach to Solve the Bandwidth Minimization Problem." In Proceedings of the 37th Annual Hawaii International Conference on System Sciences (HICSS'04), 30075.1, 2004.
[10] Barnard, S. T., A. Pothen, and H. D. Simon. "A Spectral Algorithm for Envelope Reduction of Sparse Matrices." Journal of Numerical Linear Algebra with Applications 2, no. 4 (1995): 317–334.
[11] Sloan, S. "A Fortran Program for Profile and Wavefront Reduction." International Journal for Numerical Methods in Engineering 28, no. 11 (1989): 2651–2679.
[12] Reid, J. K. and J. A. Scott. "Ordering Symmetric Sparse Matrices for Small Profile and Wavefront." International Journal for Numerical Methods in Engineering 45, no. 12 (1999): 1737–1755.
[13] George, J. A. "Computer Implementation of the Finite-Element Method." Report STAN CS-71-208, PhD Thesis, Department of Computer Science, Stanford University, Stanford, California, 1971.
[14] Sugiyama, K., S. Tagawa, and M. Toda. "Methods for Visual Understanding of Hierarchical Systems." IEEE Trans. Syst. Man, Cybern. 11, no. 2 (1981): 109–125.
[15] Gansner, E. R., E. Koutsofios, S. C. North, and K. P. Vo. "A Technique for Drawing Directed Graphs." IEEE Trans. Software Engineering 19, no. 3 (1993): 214–230.
[16] Quigley, A. "Large Scale Relational Information Visualization, Clustering, and Abstraction." PhD Thesis, Department of Computer Science and Software Engineering, University of Newcastle, Australia, 2001.
[17] Hu, Y. F. "Efficient, High-Quality Force-Directed Graph Drawing." The Mathematica Journal 10, no. 1 (2006): 37–71.

 
    
    
    
    
    
   