---
title: Natural Visibility Graph Analysis
url: https://www.emergentmind.com/topics/natural-visibility-graph-nvg
type: topic
---

# Natural Visibility Graph Analysis

A Natural Visibility Graph (NVG) is an undirected, unweighted graph derived from an ordered sequence of real-valued observations, typically a time series or a discretized profile (terrain). In NVG construction, each datum is associated to a graph node, and an edge is drawn between two nodes if, and only if, all intermediate points are strictly below the straight line joining their corresponding data values. NVGs encode the geometric and temporal structure of the sequence in a graphical framework, enabling the application of complex network theory to time series analysis, spatial profile characterization, and related pattern recognition tasks [1711.03734, 1510.01318, 1904.08746]. 

## 1. Algorithmic Construction and Mathematical Foundations

Given a univariate real-valued series $\{x_t\}_{t=1}^N$ or an ordered spatial profile (terrain), the Natural Visibility Graph is defined as follows. Nodes $i$ and $j$ ($i<j$) are connected by an edge if, for every intermediate index $k$ with $i<k<j$,
\[
x_k < x_i + (x_j - x_i)\frac{k - i}{j - i}
\]
This criterion can be interpreted geometrically: the line segment from $(i, x_i)$ to $(j, x_j)$ is not occluded by any $(k, x_k)$ in between; all intermediate points lie strictly below the joining line [1711.03734, 2311.12389, 1510.01318, 1904.08746].

For spatial terrains, this extends by considering nodes as vertices of the terrain, ordered in $x$, and applying the visibility criterion in the $(x, y)$-plane. NVGs generalize to scalar fields of higher dimension by projecting along multiple directions and applying the visibility rule to 1D slices [1702.07813, 1904.08746]. The resulting NVG is always connected, contains a natural Hamiltonian path, and is invariant under affine rescaling of amplitude and abscissa [1510.01318].

## 2. Graph-Theoretic and Structural Properties

NVGs possess distinct combinatorial and structural features:
- **Hamiltonian Path**: The sequence order always induces a path $1-2-\cdots-N$ [1904.08746].
- **Forbidden Subgraphs**: NVGs are persistent graphs, i.e., graphs on an ordered set satisfying the X-property and bar-property:
  - *X-property*: For any $p<q<r<s$, if $\{p, r\}, \{q, s\} \in E$, then $\{p, s\} \in E$.
  - *Bar-property*: For any non-consecutive $\{p, q\}\in E$, there exists $r$ with $p<r<q$ such that $r$ is adjacent to both $p$ and $q$ [1904.08746].
- **Cycles and Antiholes**: NVGs may contain holes (induced cycles $C_k$), but with strict order constraints. No NVG contains an induced antihole of size $k\ge 6$ [1904.08746].
- **Degree-Sequence Non-uniqueness**: NVGs are not characterized by ordered degree-sequence; non-isomorphic terrains can possess identical degree sequences.
- **Planarity**: While always connected, NVGs may be non-outerplanar, in contrast to HVGs which are always outerplanar [1510.01318].
- **Non-closure under Monotonic Transformation**: Unlike HVG, the NVG mapping is not invariant under general monotonic (non-affine) transformations of data values [1510.01318, 1702.07813].

## 3. Computational Algorithms and Complexity

The naive NVG construction is $O(N^2)$, involving pairwise comparison for all node pairs and checking all intermediate points [1510.01318, 1711.03734, 2311.12389]. Multiple algorithmic advancements have been proposed:
- **Divide-and-Conquer**: Reduces average-case complexity to $O(N \log N)$ [1510.01318, 1905.03204].
- **Online BST Encoder/Decoder**: By maintaining a max-oriented binary search tree indexed by amplitude, NVG construction supports efficient batch updates in $O(m \log n)$ amortized and average-case $O(n \log n)$ for full construction. Worst-case for degenerate series is $O(n^2)$ [1905.03204].
- **Linear-Time Online LOT-NVG**: For streaming and sliding-window scenarios, a backward-scan with "min-slope" statistics enables strict $O(N)$ per-update construction, suitable for high-frequency, latency-sensitive applications. Memory requirements are minimal, storing only the adjacency dictionary of neighbor sets [2311.12389].

A summary comparison is shown below:

| Algorithm        | Average Complexity | Memory Usage | Notes                    |
| ---------------- | ----------------- | ----------- | ------------------------ |
| Naive            | $O(N^2)$          | $O(N^2)$    | All pairs tested         |
| Divide-Conquer   | $O(N \log N)$     | $O(N)$      | Rebuilds per window      |
| BST Encoder      | $O(n \log n)$     | $O(n)$      | Online/batch update      |
| LOT (Online)     | $O(N)$ per step   | $O(N)$      | Sliding window, streaming|

The choice depends on data size, latency constraints, and update frequency.

## 4. Metrics and Feature Extraction

NVGs enable extraction of a variety of network-theoretic metrics:

- **Degree Centrality**: $k_i = \sum_j A_{ij}$; network average $\langle k \rangle = \frac{1}{N}\sum_i k_i$. Encodes global visibility structure; $\langle k \rangle$ scales logarithmically for random series [1711.03734, 1510.01318, 1702.07813].
- **Transitivity (Clustering Coefficient)**: $Tr = \frac{3N_\Delta}{N_3}$, with $N_\Delta$ triangles, $N_3$ connected triples. Measures inter-visibility of neighborhoods [1711.03734].
- **Mean Link-Length**: $\langle d_{1n} \rangle = \frac{1}{N} \sum_i d_{1n}(i)$ where $d_{1n}(i) = \frac{1}{k_i}\sum_{j \in \Gamma_i}|t_j-t_i|$. Quantifies mean temporal separation among visible node pairs; lower values indicate more frequent extreme events [1711.03734].
- **Motif Profiles**: The frequency of small induced subgraphs (e.g., 4-node sequential motifs) can be computed exactly or numerically. For instance, the 4-motif profile $Z^4=(\Phi_1,...,\Phi_6)$ can distinguish dynamical classes such as i.i.d. noise, chaotic maps, or AR(1) red noise [1605.02645].
- **Degree Distributions**: For i.i.d. random series, the NVG degree distribution is $P(k) = 2/[k(k+1)]$, independent of the marginal [1702.07813].
- **Irreversibility (Kullback Divergence of In/Out Degree)**: Assessing time reversibility by comparing in- and out-degree distributions of the directed NVG. $D_{KL}(in||out) = \sum_k P_{in}(k)\ln [P_{in}(k)/P_{out}(k)]$; $D=0$ indicates reversibility [1510.01318, 1605.02645].

These features provide discriminative signatures for distinguishing stochastic from deterministic dynamics, detecting irreversibility, and extracting global and local timescale statistics [1711.03734, 1510.01318, 1605.02645].


## 5. Applications and Methodological Extensions

NVGs have been employed in multiple domains:

- **Time-Series Analysis**: Characterization of deterministic vs. stochastic signals, regime detection in turbulence (using degree, clustering, mean link-length), motif-based randomness tests, and extraction of multiscale features [1711.03734, 1605.02645, 1510.01318].
- **Spatial Profiles and Terrains**: Analysis of elevation graphs, terrain navigation, and geometric profile extraction by interpreting spatial series as terrains and constructing their NVGs [1904.08746].
- **Medical Data**: Feature extraction from ECG and EEG for classification via NVG-based clustering coefficients, centrality, or motif rates [1904.08746].
- **Streaming and Online Analytics**: Real-time monitoring of financial data, anomaly detection in sensor streams, rapid computation of evolving NVG features for online forecasting and classification [2311.12389, 1905.03204].
- **Multidimensional Scalar Fields**: Generalization of NVG to arbitrary $d$-dimensional fields (e.g., image or spatial data), with applications in image processing, material science, and cancer progression analysis [1702.07813].

The parametric NVG (PNVG) further introduces a continuous "view angle" $\alpha$, filtering edges by their slope to reveal hierarchical or percolation-like features and yielding percolation transitions and clustering phenomena not accessible in the static NVG [1208.6365].

## 6. Comparative Analysis: NVG versus HVG and Robustness

The Horizontal Visibility Graph (HVG) is a subgraph of the NVG, defined by the stricter criterion $x_k < \min(x_i, x_j)$ for all $k$ between $i$ and $j$ [1510.01318, 1702.07813]. HVG is invariant under monotonic transformations and always outerplanar, admitting linear-time construction in many cases. NVG, by virtue of encoding amplitude and convexity information, is more sensitive to marginal distributions and cannot be mapped bijectively by monotonic transforms (except for affine) [1510.01318, 1605.02645].

Motif frequencies and irreversibility statistics exhibit different robustness properties: HVG-based measures are more robust to colored noise, whereas NVG motif profiles are more robust to white noise contamination [1605.02645]. 

For benchmark processes:
- White noise yields reversible NVG and HVG.
- Chaotic or memory-containing processes yield finite irreversibility.
- Random walks remain reversible for NVG even with drift due to linear-trend invariance.

The choice between NVG and HVG depends on the type of invariance or sensitivity (amplitude, order, nonlinearity) desired for the application.

## 7. Limitations and Open Research Problems

NVGs possess several methodological and theoretical limitations:
- **Computational Cost**: Quadratic time complexity for naive algorithms restricts applicability to large datasets, despite progress in online and divide-and-conquer acceleration [1905.03204, 2311.12389].
- **Uniqueness and Recognition**: No complete graph-theoretic characterization is known. While persistence (X- and bar-property) is necessary, it is not sufficient; not all unit-interval graphs are NVGs, and there exist non-isomorphic terrains with identical degree profiles [1904.08746].
- **Affine but not General Monotonic Invariance**: NVG construction is not robust to arbitrary nonlinear value transformations [1510.01318].
- **Physical Interpretation of Metrics**: Degree centrality conflates peaks and irregularities; clustering may be dominated by scale, requiring context-specific interpretation [1711.03734].
- **Univariate and Undirected Restriction**: Standard NVG mapping does not encode multivariate coupling or directionality beyond basic time orientation; extensions to multivariate or weighted variants remain challenging [1711.03734].
- **Streaming/Windowing Limitations**: Linear-time online algorithms for fixed windows may lose long-range correlations, necessitating multi-window analysis or multitree data structures for full multiscale coverage [2311.12389].

Key open questions include: the existence of a full graph-theoretic specification, polynomial-time recognition, tractability of classic graph problems on general NVGs, and development of efficient algorithms for higher-dimensional and multivariate extensions [1904.08746]. Research continues on connecting NVG structural features to physical or biological mechanisms in time series and spatial fields.

Source: https://www.emergentmind.com/topics/natural-visibility-graph-nvg