.. _metrics-label:

Metrics
======================

Crossings
~~~~~~~~~~~~~~~~~~~

+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Metric                                            | Description                                                                                                                                                                                                                                                           | Source                                    | Implementation                                        |
+===================================================+=======================================================================================================================================================================================================================================================================+===========================================+=======================================================+
| Crossings                                         | A list of all crossings                                                                                                                                                                                                                                               | :cite:t:`10.1007/BFb0021827`              | :func:`crossings.get_crossings`                       |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Crossing number                                   | Number of crossings                                                                                                                                                                                                                                                   | :cite:t:`10.1007/BFb0021827`              | :func:`crossings.number_of_crossings`                 |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Crossing density                                  | The total number of crossings divided by the number of possible crossings                                                                                                                                                                                             | :cite:t:`purchase_landscape`              | :func:`crossings.crossing_density`                    |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Crossing angles                                   | A list of all angles between pairwise crossing edges                                                                                                                                                                                                                  | :cite:t:`coleman_aesthetics-based_1996`   | :func:`crossings.crossing_angles`                     |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Crossing angular resolution                       | The minimum angle formed between two pair-wise crossing edges                                                                                                                                                                                                         | :cite:t:`coleman_aesthetics-based_1996`   | :func:`crossings.crossing_angular_resolution`         |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+

Area and boundary
~~~~~~~~~~~~~~~~~~~

+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Metric                                            | Description                                                                                                                                                                                                                                                           | Source                                    | Implementation                                        |
+===================================================+=======================================================================================================================================================================================================================================================================+===========================================+=======================================================+
| Area                                              | The size of an axis-aligned rectangular bounding box                                                                                                                                                                                                                  | :cite:t:`taylor_applying_2005`            | :func:`boundary.area`                                 |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Tight area                                        | The size of the convex hull of the graph                                                                                                                                                                                                                              | :cite:t:`taylor_applying_2005`            | :func:`boundary.area_tight`                           |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Height                                            | Height of the graph                                                                                                                                                                                                                                                   |                                           | :func:`boundary.height`                               |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Width                                             | Width of the graph                                                                                                                                                                                                                                                    |                                           | :func:`boundary.width`                                |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Aspect ratio                                      | The proportion between the smaller and the bigger side of the axis-aligned rectangular bounding box containing the graph                                                                                                                                              | :cite:t:`taylor_applying_2005`            | :func:`boundary.aspect_ratio`                         |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+

Node distribution
~~~~~~~~~~~~~~~~~~~

+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Metric                                            | Description                                                                                                                                                                                                                                                           | Source                                    | Implementation                                        |
+===================================================+=======================================================================================================================================================================================================================================================================+===========================================+=======================================================+
| Center of mass                                    | The average position of all nodes, optionally weighted by supplying a weight vector.                                                                                                                                                                                  |                                           | :func:`distribution.center_of_mass`                   |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Closest pair of points                            | The closest pair of nodes in the drawing                                                                                                                                                                                                                              | :cite:t:`ivapp15`                         | :func:`distribution.closest_pair_of_points`           |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Closest pair of elements                          | The closest pair of graph elements, i.e. points and line segments.                                                                                                                                                                                                    | :cite:t:`ivapp15`                         | :func:`distribution.closest_pair_of_elements`         |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Concentration                                     | Indicates how evenly nodes are spread among the bounding box                                                                                                                                                                                                          | :cite:t:`taylor_applying_2005`            | :func:`distribution.concentration`                    |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Homogeneity                                       | Measure of how evenly nodes are distributed among the four quadrants between 0 and 1. A value of 0 indicates an even distribution among the four quadrants.                                                                                                           | :cite:t:`taylor_applying_2005`            | :func:`distribution.homogeneity`                      |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Horizontal balance                                | Returns a value between -1 and 1 indicating the horizontal balance. A value of 0 means a perfectly even balance between the upper and lower half. A value of -1 means that all  nodes lie on the lower half, a value of 1 means that all nodes lie on the upper half. | :cite:t:`tamassia_automatic_1988`         | :func:`distribution.horizontal_balance`               |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Vertical balance                                  | Returns a value between -1 and 1 indicating the vertical balance. A value of 0 means a perfectly even balance between the left and right half. A value of -1 means that all nodes  lie on the left half, a value of 1 means that all nodes lie on the right half.     | :cite:t:`tamassia_automatic_1988`         | :func:`distribution.vertical_balance`                 |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Node orthogonality                                | A measure of how much the nodes align in a grid.                                                                                                                                                                                                                      | :cite:t:`purchase_metrics_2002`           | :func:`distribution.node_orthogonality`               |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Gabriel ratio                                     | The Gabriel ratio is defined as the percentage of nodes falling within a minimum circle covering an edge for any edge.                                                                                                                                                | :cite:t:`purchase_landscape`              | :func:`distribution.gabriel_ratio`                    |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+

Edge directions
~~~~~~~~~~~~~~~~~~~

+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Metric                                            | Description                                                                                                                                                                                                                                                           | Source                                    | Implementation                                        |
+===================================================+=======================================================================================================================================================================================================================================================================+===========================================+=======================================================+
| Angular resolution                                | The angular resolution is defined as the minimum angle between two edges incident to the same vertex.                                                                                                                                                                 | :cite:t:`coleman_aesthetics-based_1996`   | :func:`edge_directions.angular_resolution`            |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Average flow                                      | The average edge direction of a directed graph.                                                                                                                                                                                                                       | :cite:t:`bennett_aesthetics_2007`         | :func:`edge_directions.average_flow`                  |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Upwards flow                                      | This measures the percentage of edges pointing ’upwards’, meaning that the angle between the edge and the upward vector is strictly smaller than 90°. Only defined for directed graphs.                                                                               | :cite:t:`purchase_metrics_2002`           | :func:`edge_directions.upwards_flow`                  |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Coherence to average flow                         | The upwards flow with the average flow as the ’upwards’ direction. Only defined for directed graphs.                                                                                                                                                                  | :cite:t:`purchase_metrics_2002`           | :func:`edge_directions.coherence_to_average_flow`     |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Edge orthogonality                                | A measure of the extend to which the edge are vertically or horizontally aligned.                                                                                                                                                                                     | :cite:t:`purchase_metrics_2002`           | :func:`edge_directions.edge_orthogonality`            |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+

Symmetry
~~~~~~~~~~~~~~~~~~~

+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Metric                                            | Description                                                                                                                                                                                                                                                           | Source                                    | Implementation                                        |
+===================================================+=======================================================================================================================================================================================================================================================================+===========================================+=======================================================+
| Node-based symmetry                               | This metric tries to estimate reflective symmetry by checking for symmetry axes along each pair of nodes.                                                                                                                                                             | :cite:t:`purchase_metrics_2002`           | :func:`symmetry.reflective_symmetry`                  |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Edge-based symmetry                               | A metric for estimating either reflective, rotational or translational symmetry.                                                                                                                                                                                      | :cite:t:`chapman_symmetry_2018`           | :func:`symmetry.edge_based_symmetry`                  |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Stress-based symmetry                             | As the stress of a graph has been shown to correlate with symmetry, this metric simply calculates the stress of the given graph.                                                                                                                                      | :cite:t:`welch_measuring_2017`            | :func:`symmetry.stress`                               |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Even neighborhood distribution                    | This metric estimates how evenly the neighborhood of each vertex is distributed around the barycenter of the neighborhood.                                                                                                                                            | :cite:t:`xu_force-directed_2018`          | :func:`symmetry.even_neighborhood_distribution`       |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+
| Visual symmetry                                   | Given the time complexity of the previous symmetry metrics, this metric draws an image of the graph and estimates symmetry in a pixel-based manner.                                                                                                                   |                                           | :func:`symmetry.visual_symmetry`                      |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+-------------------------------------------------------+


Bibliography
---------------------
.. bibliography::

