Papers
Topics
Authors
Recent
Search
2000 character limit reached

Horizontal Visibility Algorithm

Updated 10 July 2026
  • The horizontal visibility algorithm is a mapping that converts ordered numerical sequences into graphs where nodes connect if all intermediate values are lower.
  • It defines a unique class of noncrossing, outerplanar graphs with a Hamilton path, enabling rigorous analytical results in time-series and combinatorics.
  • The approach supports efficient linear-time computation and has versatile applications, including chaotic, periodic, and multivariate data analysis.

The horizontal visibility algorithm is a mapping from an ordered numerical sequence to a graph in which each datum becomes a vertex and two vertices are adjacent precisely when every intermediate datum is strictly lower than both endpoints. In the standard formulation, an Horizontal Visibility Graph (HVG) is associated with an ordered set of non-negative reals, and the mapping converts temporal order and relative magnitude into a noncrossing graph structure that is analytically tractable and useful for time-series analysis, combinatorics, and graph theory (Gutin et al., 2010).

1. Definition and basic construction

Given an ordered sequence X=(x1,x2,,xn)X=(x_1,x_2,\ldots,x_n), the HVG G=(V,E)G=(V,E) has one vertex for each xix_i. There is an edge between xix_i and xjx_j with i<ji<j if for every kk satisfying i<k<ji<k<j,

xk<min{xi,xj}.x_k < \min\{x_i,x_j\}.

Equivalently, two data points “see” each other horizontally if all intermediate points are strictly lower. In the time-series literature this same criterion is also written as xi,xj>xnx_i,x_j>x_n for all G=(V,E)G=(V,E)0 (Gutin et al., 2010).

This construction is always connected because each node is adjacent to its nearest temporal neighbors. The resulting graph is an undirected graph in the basic setting, although directed versions orient edges from earlier to later indices and define in-degree and out-degree accordingly (Xie et al., 2019). The algorithm is simpler than the original visibility-graph construction and became important in part because exact topological results can be derived for several classes of sequences (Luque et al., 2010).

In applications, the graph is interpreted as a reduced representation of the series. Degree, clustering, path length, motifs, and related graph observables are then used as descriptors of the generating dynamics. This suggests that the HVG is not merely a visualization device but a mathematically constrained encoding of order statistics.

2. Structural characterization in graph theory

A central theorem gives a complete graph-theoretic characterization: a graph is an HVG if and only if it is outerplanar and has a Hamilton path (Gutin et al., 2010). Here, outerplanarity means that the graph can be embedded in the plane without edge crossings with all vertices incident to the unbounded face, and the Hamilton path is the path visiting vertices in sequence order.

This result has several immediate consequences. First, HVGs are noncrossing graphs in the sense of algebraic combinatorics. Second, the class of HVGs is exactly the class of outerplanar Hamiltonian-path graphs, so the visibility condition is equivalent to a purely graph-theoretic description (Gutin et al., 2010). Third, maximal HVGs coincide with maximal outerplanar graphs; in particular, when the graph is maximal outerplanar its number of edges is G=(V,E)G=(V,E)1 (Gutin et al., 2010).

The characterization also yields an algorithmic corollary: HVG recognition is linear-time. The argument given is that recognizing outerplanar graphs can be done in G=(V,E)G=(V,E)2 time and checking for a Hamilton path in an outerplanar graph can also be done in G=(V,E)G=(V,E)3 time, so one can determine in linear time whether a given graph is an HVG (Gutin et al., 2010).

A common misconception is to identify HVGs with planar graphs in general or even with outerplanar graphs in general. The exact theorem excludes both simplifications: the Hamilton-path condition is essential, and arbitrary planar graphs lie far outside the HVG class. The visibility rule therefore defines a narrow and rigid subclass of sparse graphs.

3. Words, visible pairs, and enumeration

A distinctive feature of the foundational combinatorial treatment is the reinterpretation of ordered sets as words. If G=(V,E)G=(V,E)4 is regarded as a word over an alphabet, then a pair G=(V,E)G=(V,E)5 with G=(V,E)G=(V,E)6 is called a visible pair if all intermediate letters satisfy

G=(V,E)G=(V,E)7

The number of visible pairs in the word equals the number of edges in the associated HVG (Gutin et al., 2010).

This correspondence allows the use of generating functions. For words of length G=(V,E)G=(V,E)8 over an alphabet of size G=(V,E)G=(V,E)9, the generating function for the total number of visible pairs is

xix_i0

Using this framework, the asymptotic average number of edges in HVGs formed from random words on xix_i1 is

xix_i2

where xix_i3 is the digamma function and xix_i4 is the Euler–Mascheroni constant (Gutin et al., 2010).

Later work sharpened the combinatorics of the class. For data sequences without equal entries, HVGs are completely determined by their ordered degree sequence, and distinct HVGs on xix_i5 vertices arising from pairwise distinct data have different ordered degree sequences (Juhnke-Kubitzke et al., 2021). The same work shows that HVGs for data sequences without equal entries are counted by the Catalan numbers,

xix_i6

whereas HVGs allowing equal entries are counted by the large Schröder numbers,

xix_i7

for xix_i8 (Juhnke-Kubitzke et al., 2021).

These results place HVGs inside classical Catalan- and Schröder-enumerated families. A common overstatement is that the degree sequence always determines the graph. The precise statement is narrower: this uniqueness holds for HVGs generated by data sequences with all entries distinct (Juhnke-Kubitzke et al., 2021).

4. Exact results for random, periodic, and chaotic series

For i.i.d. random series, the HVG has a universal exponential degree distribution,

xix_i9

independently of the probability distribution from which the series was generated. The mean degree is xix_i0, the local clustering coefficient satisfies xix_i1, the mean path length scales as

xix_i2

and the probability that two nodes at distance xix_i3 are connected is

xix_i4

These exact results make HVGs analytically solvable for uncorrelated randomness and provide a direct reference model for detecting non-random structure (Luque et al., 2010).

For periodic series with period xix_i5 and no repeated values within a period, the mean degree is

xix_i6

which can be inverted to estimate the period. On this basis a graph-theoretical noise reduction filter introduces a threshold xix_i7 and connects xix_i8 and xix_i9 when

xjx_j0

Plateaus in the filtered mean degree xjx_j1 reveal the intrinsic period of noisy periodic signals, and the method can avoid false periodicity indications in certain chaotic cases where autocorrelation is misleading (Núñez et al., 2011).

In deterministic dynamics, the HVG formalism supports deeper analytical programs. In the Feigenbaum scenario, period-doubling and band-splitting attractor cascades generate families of graphs whose degree distributions, mean distances, clustering coefficients, and entropy can be derived analytically; the corresponding renormalization-group scheme has fixed-point graphs, and the graph entropy emulates the Lyapunov exponent independently of its sign (Luque et al., 2012). For type-I intermittency, the alternation of laminar episodes and chaotic bursts produces a mixed graph structure in which the variance of the degree distribution scales as

xjx_j2

matching the characteristic scaling of the mean laminar length, while block entropies over degree sequences inherit the power-law scaling of the Lyapunov exponent (Núñez et al., 2013).

Other statistical descriptors have also proved discriminative. Tetradic motif frequencies in HVGs derived from multifractal binomial measures converge to

xjx_j3

while for fractional Gaussian noises they depend nonlinearly on the Hurst exponent and series length, and in heartbeat-rate data they distinguish healthy subjects, congestive heart failure subjects, and atrial fibrillation subjects (Xie et al., 2018). In turbulent-flow data, HVGs of velocity time series show universal degree distributions at high Reynolds numbers, whereas acceleration-series degree distributions have stretched exponential forms with a Reynolds-number-dependent fitting parameter, together with a transitional behavior in several network features (Manshour et al., 2015).

Taken together, these results explain why degree distributions became a prominent discriminator between randomness and chaos in the early HVG literature: the random benchmark is exact, while many deterministic regimes yield systematic and interpretable departures.

5. Generalizations and domain-specific variants

A major extension is the limited penetrable horizontal visibility graph, denoted LPHVG(xjx_j4). In this variant, two nodes are connected when there exist at most xjx_j5 intermediate data points xjx_j6 in xjx_j7 such that xjx_j8. The classical HVG is recovered at xjx_j9. For bi-infinite i.i.d. random series, the degree distribution is

i<ji<j0

with mean degree i<ji<j1. Directed and image variants, DLPHVG(i<ji<j2) and ILPHVGi<ji<j3, extend the framework to irreversibility analysis and to matrices or spatial fields, respectively (Wang et al., 2017). Earlier exact results on LPHVG emphasized the same universal exponential law, exact clustering expressions, and a long-distance visibility probability

i<ji<j4

and used deviations from the random theory to distinguish chaotic and empirical series from uncorrelated randomness (Wang et al., 2017).

For multivariate time series, the multilayer horizontal visibility graph introduces cross-horizontal visibility between lagged timestamps of different components. In this construction, intra-layer edges are standard HVG edges within each component, while inter-layer edges are added when pairs of observations in different series satisfy a cross-visibility criterion across intermediate times. The method is described as parameter-free, does not require data pre-processing, and uses multilayer topological measures together with a ratio-degree feature

i<ji<j5

to characterize joint structure. The reported experiments indicate that inter-layer edges preserve information that would be lost in single-layer and multiplex representations, while also complementing the information in intra-layer edges (Silva et al., 2023).

Specialized variants also appeared in application-driven settings. The Temporary Horizontal Visibility Graph (THVG) modifies HVG for information-source impact networks by using a temporal window i<ji<j6 and source ratings. A directed link from node i<ji<j7 to node i<ji<j8 is established when

i<ji<j9

In the reported cybersecurity-news application, THVG is more effective than the usual HVG design method by kk0 in F-measure, kk1 in completeness, and kk2 in accuracy (Lande et al., 2019).

Beyond numerical time series, the compactified horizontal visibility graph was proposed for language networks. Word occurrences are first mapped to an HVG using a weight derived from the standard deviation of distances between repeated occurrences, after which all occurrences of the same word are merged into a single node and multiple edges are collapsed. The resulting networks are reported to be scale free, and among the highest-degree nodes appear not only function words relevant to text structure communication but also words that determine the informational structure of the text (Lande et al., 2013).

6. Computation, online algorithms, and scope

The original structural characterization already implies linear-time recognition of whether a given graph is an HVG (Gutin et al., 2010). More recent work addressed the transformation problem itself in streaming settings. The LOT framework formulates two online requirements—efficient update and efficient elimination—and gives a linear-time online method for both natural and horizontal visibility graph transformations on sliding windows. For HVG, the update traverses the current window from the back, maintains the maximum value seen so far, and adds edges to the newest node whenever

kk3

With an adjacency dictionary representation, node elimination and graph update are both kk4 per step, and a monotonic-stack optimization preserves linear time while improving practical efficiency (Huang et al., 2023).

This computational development matters because much of the HVG literature presumes offline access to complete sequences, whereas many practical data sources are streams. The LOT results suggest that HVG-based analysis can be used in latency-sensitive settings without rebuilding the graph from scratch at every update.

The scope of HVG methods is broad but not unlimited. The strongest exact theorems are concentrated in specific regimes: i.i.d. random series, periodic sequences, several self-similar deterministic constructions, and the combinatorics of the graph class itself. Application papers repeatedly show discriminative performance—for example in chaos-versus-randomness tests, irreversibility detection, multivariate dependence analysis, turbulence, heartbeat dynamics, information-source influence, and language networks—but the underlying guarantees differ across variants and domains (Luque et al., 2010). A plausible implication is that HVG is best understood as a family of rigorously constrained mappings whose interpretive power is highest when empirical use is anchored to the corresponding exact theory.

In contemporary usage, the horizontal visibility algorithm occupies a distinctive position among time-series-to-network transformations. Its central attraction is the coexistence of three features that rarely coincide: a local geometric rule, a complete graph-theoretic characterization, and a substantial body of exact results linking graph observables to stochastic, periodic, and nonlinear dynamical structure.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (15)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Horizontal Visibility Algorithm.