Contact Us

“Shortest Path” Option for Flight Line Style (Net Bar)

Introduction

There is the recent improvement in Expert Layout Editor, the “Shortest
path” option was added to Flight line styles (Net Bar). This option allows
to build the shortest tree (network) connecting all selected nodes.

Figure 1. Layout Expert Editor screenshot.

“Tree” means the network of vertices (nodes) connected with undirected
edges (lines) which has two basic properties:

Any two vertices are connected with some path.

There are no unnecessary edges, in other words if any edge is removed then
the first property will be violated.

Figure 2. There are no edges.

“Shortest tree” means the tree with minimal summarized length of
edges. It is also called the Minimum Spanning Tree (MST). Minimum Spanning Tree
of the given set of points P on Euclidean plane is called Euclidean Minimum
Spanning Tree (EMST).

Algorithm

There are a lot of algorithms for finding the Minimum Spanning Tree (one of
them is well-known Prim’s algorithm, which is described below), but their
common problem is bad productivity.

Most of these algorithms require at least O(n2) time (where n is number of
vertices), because the first step for these algorithms is building of the complete
graph with all possible edges, where each vertex is directly connected with
any other vertex. This operation takes O(n2) time.

Such slow algorithms can be used with small number of vertices but are absolutely
inefficient with huge number of vertices. For example, processing of 10,000
vertices will be about 1,000,000 times longer than processing of 10 vertices.

To avoid this problem the set P of points on Euclidean plane is processed in
two steps.

The first step is finding the Delaunay triangulation (Figure 3) for n points
on Euclidean plane using the “divide and conquer” algorithm (presented
in [1]).

First step is to choose an arbitrary vertex v1V
and to build the set of processed vertices P = {v1}, consisting
only of v1.

Then on every step one new vertex vi is added to the set of
processed vertices P. To choose this vertex we look for smallest edge e =
(vj, vk) connecting the processed vertices with unprocessed,
vj P, vk V\P.

Process is repeated until there are no unprocessed vertices more.

Figure 4 shows the results of Prim’s algorithm.

References

Guibas, L. and Stolfi, J., “Primitives for the Manipulation of General
Subdivisions and the Computation of Voronoi Diagrams”, ACM Transactions
on Graphics, Vol.4, No.2, April 1985, pages 74-123.