Nifty 50 Graph-Constrained Portfolio Optimization

Nifty 50 universe MST & TMFG networks Classical + hierarchical baselines OOS expanding-window backtest Seven hypothesis tests Centrality & neighborhood constraints

Abstract

Asset co-movement can be summarized as a sparse network — a minimum spanning tree (MST) or a triangulated maximally filtered graph (TMFG) — rather than a dense correlation matrix. Hierarchical allocation rules such as HRP use dendrograms built from that structure, but they are not classical constrained optimizers: adding a hard risk budget, return floor, or sector tilt is awkward.

This India study follows the constraint-based route. We estimate correlation networks on Nifty 50 NSE equities, then fold graph information into long-only minimum-variance programs in two ways: (i) a linear average-centrality constraint that targets peripheral nodes, and (ii) a neighborhood restriction that discourages simultaneous investment in graph-adjacent names (mixed-integer selection and a continuous SDP-style penalty). Results are compared with unconstrained minimum variance and with HRP, HERC, and nested clustered optimization (NCO).

The report is research output for education and methodology discussion — not investment advice. Key empirical takeaways from the latest run appear first.

  • Study covers 49 Nifty 50 NSE equities with daily returns from 2019-01-01; filtered correlation networks are the MST and TMFG.
  • On the MST, the average-degree constraint target = 1 places 100% of capital in degree-1 (peripheral) names, versus 54% for unconstrained minimum variance.
  • MST neighborhood MIP drives connected-asset share to 0.00% versus 5.46% for minimum variance.
  • Out-of-sample expanding-window backtest: highest Sharpe is Equal Weight (SR=0.92, ann. vol=14.5%).
  • Hypothesis battery: 5/7 supported at the stated criterion; 5 tests reject the null at 5%.
  • Classical baselines (equal-weight, inverse-vol, max-Sharpe, min-variance) and hierarchical HRP/HERC/NCO are compared against graph centrality and neighborhood constraints on the same NSE panel.

Introduction

Three broad strands appear in network-aware allocation. Centrality screening ranks stocks by graph influence and then optimizes on a reduced universe — simple, but selection and optimization are split (Pozzi et al., 2013; Li et al., 2019; Peralta and Zareei, 2016). Mixed-integer graph models encode edges as discrete constraints inside the optimizer — flexible, but scale poorly (Puerto et al., 2020; Ricca and Scozzari, 2024). Hierarchical clustering methods — hierarchical risk parity (HRP), hierarchical equal risk contribution (HERC), and nested clustered optimization (NCO) — exploit dendrograms for diversification (López de Prado, 2016; Raffinot, 2018; Prado, 2019), yet they do not natively accept arbitrary convex constraints such as maximum risk or minimum return.

We implement the middle ground emphasized in recent graph-constraint research: keep a standard convex (or MIP-augmented) return–risk program and add centrality or neighborhood structure as explicit constraints. The empirical laboratory is Indian large caps rather than the US panel in the source literature, so conclusions speak to NSE correlation geometry.

Theoretical background

Why graphs for portfolios? Sample covariance matrices are dense and noisy. Filtering to an MST or TMFG retains the strongest co-movement links while discarding weak edges, yielding an interpretable skeleton of the market (Mantegna, 1999; Massara et al., 2017). Nodes on the periphery (low degree) are weakly tied to the rest of the network; hubs (high degree) sit near the center. Empirically, concentrating weight on peripheral names has been associated with better diversification in crisis periods (Pozzi et al., 2013).

Classical mean–variance. For expected-return vector and covariance , the long-only minimum-variance problem is

This program ignores graph structure: two highly connected neighbors can both receive large weights if that lowers variance. Hierarchical methods (HRP/HERC/NCO) use clustering on a distance transform of correlations, but the allocation step is recursive reweighting — not an optimizer with user-chosen linear or integer constraints.

Constraint philosophy. Let be any convex risk (or concave utility) and a convex feasible set. Graph information enters either as a linear average-centrality equality , or as neighborhood restrictions on which pairs may be jointly positive. Both keep the outer return–risk trade-off recognizable to portfolio construction engines.

Graph representation and portfolio measures

An undirected graph on assets has adjacency matrix with if and (no loops). The matrix power counts walks of length : entry is the number of length- walks from to .

Connection matrices. For graphs without loops, define the non-closed walk indicator at length by

where acts elementwise and is the identity. Cumulating lengths up to gives

With , (direct neighbors). Larger forbids investment in assets linked by longer paths.

Centrality vectors. Node influence is summarized by a vector . Three common choices:

- Degree: — number of incident edges. - Eigenvector centrality: if and are the leading eigenpair of , - Subgraph centrality: , measuring closed-walk participation (Estrada, 2011).

Portfolio-level graph scores. For weights with , the average centrality is the linear map

The connected-asset share measures the fraction of pairwise absolute weight products that sit on connected pairs:

where is the Hadamard (elementwise) product. If , then for every edge (or walk) in at least one endpoint has weight zero — the book does not co-invest in connected names.

The degree histograms below show how MST and TMFG distribute node degrees on the Nifty panel; those distributions motivate the numerical targets used later.

Network size: MST 48 edges · TMFG 141 edges on 49 nodes.

Node-degree histogram (MST vs TMFG)

MST leaves concentrate at degree 1; TMFG is a planar triangulation so the periphery starts at degree 3. These histograms motivate the average-degree targets used in the constrained programs.

MST and TMFG on Nifty 50

From the Pearson correlation matrix we build Mantegna distances

then extract the MST: a spanning tree of nodes and edges with minimum total distance (Kruskal/Prim). Leaves have degree one and sit on the periphery; hubs have higher degree.

The TMFG (Massara, Di Matteo & Aste) grows a planar triangulation that greedily retains high-correlation edges while preserving a tetrahedral face structure. Peripheral TMFG nodes have degree three; interior nodes accumulate higher degree. In both filters, tilting toward the periphery is a structural diversification device.

The table below lists per-name MST/TMFG degrees and MST eigenvector/subgraph scores used when forming and diagnosing portfolios.

Per-name centrality snapshot

Degree from the unweighted MST/TMFG adjacency; eigenvector and subgraph centralities use the MST adjacency. Low-degree names are natural candidates when targeting peripheral average centrality.

TickerMST degTMFG degEigenvectorSubgraph
ADANIENT130.01501.598
APOLLOHOSP130.01801.648
BAJAJ-AUTO130.00001.594
BEL140.01501.598
BHARTIARTL140.04001.822
BPCL130.04001.824
BRITANNIA130.00301.640
DRREDDY130.00601.591
EICHERMOT150.00101.694
INDUSINDBK130.02201.701
ITC130.04001.824
KOTAKBANK140.00201.696
NESTLEIND150.00301.640
ONGC150.00401.645
POWERGRID130.00201.592
RELIANCE130.00201.696
SBILIFE130.00101.594
SHRIRAMFIN130.02201.701
TATACONSUM140.04001.822
TECHM170.00101.641
TITAN160.00101.694
TRENT130.00401.645
WIPRO130.00001.592
ADANIPORTS250.04602.475
ASIANPAINT260.02102.390
BAJAJFINSV270.02602.451
CIPLA240.01702.236
HCLTECH250.00402.335
HDFCLIFE240.00202.339
HEROMOTOCO240.00102.337
HINDALCO2110.01102.395
JSWSTEEL280.04902.637
LT2110.04602.475
M&M260.00502.391
NTPC240.00502.285
SUNPHARMA250.04602.522
TCS240.00102.281
TMPV230.01102.396
BAJFINANCE390.01203.141
COALINDIA360.01303.140

Average centrality constraint — equations and results

Let be a convex risk objective — here portfolio variance — and . The centrality-constrained program is

Equation details. The equality is linear in , so the feasible set remains convex when is convex and the problem stays a convex QP for variance. We take (unweighted degree of the MST or TMFG). On the MST, peripheral targeting uses (all weight on degree-1 leaves when feasible) and a milder . On the TMFG, the planar periphery starts at degree 3, so we use .

The charts and table immediately below report realized , , volatility, and weight-by-degree composition for MST portfolios under these targets, versus unconstrained minimum variance.

Average centrality CM(x) by portfolio (MST)

Realized average node degree CM(x) = C′x. Targeting Deg=1 or applying the neighborhood MIP pins the book near the MST periphery; HRP/HERC/NCO remain closer to unconstrained min-variance.

Connected-asset share CA(x) by portfolio (MST)

Share of pairwise weight mass on graph-adjacent pairs. Zero means no two positive weights share an MST edge.

Table — MST portfolios (Eq. CM / CA diagnostics)

PortfolioStd %Avg degree CM(x)CA(x) %HoldingsDeg 1Deg 2Deg 3Deg 4Deg 6
Equal Weight1.1121.964.004946.9%30.6%10.2%8.2%4.1%
Inverse Vol1.0621.964.074946.7%30.4%10.8%8.0%4.0%
Max Sharpe1.3081.110.00988.8%11.2%0.0%0.0%0.0%
Min Variance0.8561.705.461853.6%28.8%11.2%6.4%0.0%
Degree target = 10.8981.000.0014100.0%0.0%0.0%0.0%0.0%
Degree target = 20.8612.007.011740.2%30.1%19.2%10.5%0.0%
MIP Neighborhood0.9071.000.0013100.0%0.0%0.0%0.0%0.0%
SDP-style Neighborhood0.8851.190.001680.6%19.4%0.0%0.0%0.0%
HRP1.0141.853.714949.5%30.9%10.2%6.7%2.7%
HERC1.0751.923.864948.5%28.4%12.4%7.4%3.4%
NCO0.8811.596.073157.0%29.6%10.3%3.1%0.0%

Figure — MST weight by node degree

Stacked bars show the share of portfolio weight on each node-degree class. Peripheral constraints push mass into the lowest-degree colors; unconstrained and hierarchical methods spread weight across more tiers.

Neighborhood constraints — MIP, SDP-style, and equations

Mixed-integer form (Ricca–Scozzari generalized). Binary indicators mark selected names. With connection matrix and box bounds on weights,

Equation details (MIP). The block is an independent-set constraint: if asset is selected (), no neighbor under walks of length may be selected. Linking to forces zero weight on deselected names. We use so . Implementation: solve a MILP for a high-score independent set (preferring low diagonal variance), then run minimum variance on the selected subset.

Semidefinite idea. Writing , a natural SDP asks

The Hadamard constraint drives products of connected weights to zero. Without a commercial SDP solver we use the long-only quadratic penalty surrogate

with penalty factor (default ). This shrinks adjacent weight products and approximates the same diversification intent.

Compare MIP and SDP-style columns to minimum variance in the MST diagnostics above: both drive toward zero while the degree-target forces full peripheral allocation.

Comparison with other portfolio methods

We benchmark graph constraints against two families of alternatives on the same Nifty 50 return panel:

  • Classical optimizers: equal-weight (); inverse-volatility (); long-only max Sharpe ; unconstrained minimum variance.
  • Hierarchical / clustering: HRP (single-linkage + recursive bisection), HERC-style (ward + equal-risk splits), and NCO (cluster MV then across-cluster MV).

In-sample weight diagnostics (average degree , connected-asset share , degree stacks) appear in the table and figure below. Out-of-sample performance is reported in the next section.