Graph Theory in Action: Forming an Investment Portfolio (A Case Study: Selected Companies of Tehran Stock Exchange)

Document Type : Research Paper

Authors

1 Department of Finance and Accounting, Humanities Faculty, Meybod University, Meybod, Iran

2 Department of Financial Engineering, Hazrat-e Masoumeh University, Qom, Iran

Abstract

The research aims to integrate portfolio theory and graph theory to explore the relationship between specific network properties and the diversification problem in forming stock portfolios. The stock portfolio formation process is described using graph theory. The study utilizes stock-adjusted final price data from 138 companies listed on the Tehran Stock Exchange between January 1, 2019, and July 6, spanning 918 trading days. The data is partitioned with 80% as in-sample and 20% as out-of-sample data. A proximity matrix is employed to analyze stock relationships, leading to the construction of diversified and non-diversified portfolios using an optimal threshold. Machine learning techniques and hierarchical risk parity are used to select stocks for the portfolio. The performance is compared with the minimum variance approach and the total index benchmark for both in-sample and out-of-sample periods. The Sharpe ratio evaluates the performance of both diversified and non-diversified portfolios. The findings suggest that the non-diversified approach outperforms during market crashes, while diversified portfolios perform better during other periods. Hence, diversifying the stock portfolio is unsuitable during market crashes due to strong direct correlations among stocks, causing simultaneous declines. Alternative strategies should be considered following market crashes.

Keywords

Main Subjects


Albert, R., & Barabási, A. L. (2002). Statistical mechanics of complex networks. Reviews of Modern Physics74(1), 47. https://doi.org/10.1103/RevModPhys.74.47
Attia, J. (2019). The applications of graph theory to investing. arXiv preprint arXiv:1902.00786.
https://doi.org/10.48550/arXiv.1902.00786
Azouzi, M. A. & Mghadmi, N. (2025). The Portfolio management properties of bitcoin during the coronavirus crisis. Interdisciplinary Journal of Management Studies, 18(2), 333-347. https://doi.org/10.22059/ijms.2024.375551.676692
Bechis, L., Cerri, F., & Vulpiani, M. (2020). Machine learning portfolio optimization: Hierarchical risk parity and modern portfolio theory. LUISS Guido Carli, Roma, Italy. http://tesi.luiss.it/28022/1/709261_BECHIS_LUCA.pdf
Berouaga, Y., El Msiyah, C., & Madkour, J. (2023). Portfolio optimization using minimum spanning tree model in the Moroccan stock exchange market. International Journal of Financial Studies11(2), 53. https://ideas.repec.org/a/gam/jijfss/v11y2023i2p53-d1104772.html
Bonanno, G., Caldarelli, G., Lillo, F., Micciche, S., Vandewalle, N., & Mantegna, R. N. (2004). Networks of equities in financial markets. The European Physical Journal B38, 363-371. https://doi.org/10.1140/epjb/e2004-00129-6
Brinson, G. P., Hood, L. R., & Beebower, G. L. (1995). Determinants of portfolio performance. Financial Analysts Journal51(1), 133-138. https://doi.org/10.2469/faj.v51.n1.1869
Burggraf, T. (2021). Beyond risk parity–A machine learning-based hierarchical risk parity approach on cryptocurrencies. Finance Research Letters38, 101523. https://doi.org/10.1016/j.frl.2020.101523
Chi, K. T., Liu, J., & Lau, F. C. (2010). A network perspective of the stock market. Journal of Empirical Finance17(4), 659-667. https://doi.org/10.1016/j.jempfin.2010.04.008
Danko, J., & Šoltés, V. (2018). Portfolio creation using graph characteristics. Investment Management & Financial Innovations15(1), 180. https://doi.org/10.21511/imfi.15(1).2018.16.
Dimitrios, K., & Vasileios, O. (2015). A network analysis of the Greek stock market. Procedia Economics and Finance33, 340-349. https://doi.org/10.1016/S2212-5671(15)01718-9
Dickson, A. (2006) Introduction to graph theory. CRC Pres. www.math.utah.edu/mathcircle/notes/MC_Graph_Theory.pdf
Fortunato, S. (2010). Community detection in graphs. Physics reports486(3-5), 75-174. https://doi.org/10.1016/j.physrep.2009.11.002
Huang, W. Q., Zhuang, X. T., & Yao, S. (2009). A network analysis of the Chinese stock market. Physica A: Statistical Mechanics and its Applications388(14), 2956-2964. https://doi.org/10.1016/j.physa.2009.03.028
Hüttner, A., Mai, J. F., & Mineo, S. (2018). Portfolio selection based on graphs: Does it align with Markowitz-optimal portfolios? Dependence Modeling6(1), 63-87. https://doi.org/10.1515/demo-2018-0004
Kheyrkhah, A., Rahnamay Roodposhti, F., & Afshar Kazemi, M. A. (2016). Using the theory of network in finance. International Journal of Finance & Managerial Accounting1(2), 9-23. https://ijfma.srbiau.ac.ir/article_9527.html.
Kim, K., Kim, S. Y., & Ha, D. H. (2007). Characteristics of networks in financial markets. Computer Physics Communications177(1-2), 184-185. https://doi.org/10.1016/j.cpc.2007.02.037
Kumar, S., & Deo, N. (2012). Correlation and network analysis of global financial indices. Physical Review E86(2), 026101. https://doi.org/10.1103/PhysRevE.86.026101
Lan, W., & Zhao, G. (2010, October). Stocks network of coal and power sectors in China stock markets. In International Conference on Information Computing and Applications (pp. 201-208). Springer Berlin Heidelberg.
https://doi.org/10.1007/978-3-642-16336-4_27
Liu, J., Chi, K. T., & He, K. (2008, September). Detecting stock market fluctuation from stock network structure variation. In International Symposium on Nonlinear Theory and Its Applications, NOLTA'08. Budapest, Hungary. https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=61758028c040ac09c5f016516cdd9adf16066ebf
Liu, J., Tse, C. K., & He, K. (2011). Fierce stock market fluctuation disrupts scale-free distribution. Quantitative Finance11(6), 817-823. https://doi.org/10.1080/14697680902991627
López De Prado, M. L. (2016). Building diversified portfolios that outperform out- of- sample. The Journal of Portfolio Management42(4), 59-69. https://doi.org/10.3905/jpm.2016.42.4.059
Mantegna, R. N. (1999). Hierarchical structure in financial markets. The European Physical Journal B-Condensed Matter and Complex Systems11, 193-197. https://doi.org/10.1007/s100510050929
Markowitz, H. (1952). Portfolio Selection. The Journal of Finance, 7(1), 77–91. https://doi.org/10.12987/9780300191677.
Mizuno, T., Takayasu, H., & Takayasu, M. (2006). Correlation networks among currencies. Physica A: Statistical Mechanics and its Applications364, 336-342. https://doi.org/10.1016/j.physa.2005.08.079
Newman, M. E. (2003). The structure and function of complex networks. SIAM Review45(2), 167-256. https://doi.org/10.1137/S003614450342480
Nourahmadi, M., & Sadeqi, H. (2021). Hierarchical risk parity as an alternative to conventional methods of portfolio optimization: A study of Tehran Stock Exchange. Iranian Journal of Finance5(4), 1-24. https://doi.org/10.30699/ijf.2021.289848.1242
Nourahmadi, M., & Sadeqi, H. (2022). A machine learning-based hierarchical risk parity approach: A case study of portfolio consisting of stocks of the top 30 companies on the Tehran Stock Exchange. Financial Research Journal24(2), 236-256. https://doi.org/10.22059/frj.2021.319092.1007146 
Onnela, J. P., Chakraborti, A., Kaski, K., Kertesz, J., & Kanto, A. (2003). Dynamics of market correlations: Taxonomy and portfolio analysis. Physical Review E68(5), 056110. https://doi.org/10.1103/PhysRevE.68.056110
Peralta, G., & Zareei, A. (2016). A network approach to portfolio selection. Journal of Empirical Finance38, 157-180. https://doi.org/10.1016/j.jempfin.2016.06.003
Sadeghi Moghadam, M. R., Mansouri, T., & Sheykhizadeh, M. (2022). Markowitz-Based cardinality constrained portfolio selection using asexual reproduction optimization (ARO). Interdisciplinary Journal of Management Studies15(3), 531-548.
Sharpe, W. F. (1963). A simplified model for portfolio analysis. Management Science, 9(2), 277-293. https://doi.org/10.1287/mnsc.9.2.277
Sharpe, W. F. (1964). Capital asset prices: A theory of market equilibrium under conditions of risk. The Journal of Finance19(3), 425-442.  https://doi.org/10.1111/j.1540-6261.1964.tb02865.x
Sharpe, W. F. (1971). A linear programming approximation for the general portfolio analysis problem. Journal of Financial and Quantitative Analysis, 6(5), 1263-1275. https://doi.org/10.2307/2329860
Šoltés, V., & Danko, J. (2017). Proposal of creation of a portfolio with minimal risk. Invest. Manag. Financ. Innov.14, 107-15. https://doi.org/10.21511/imfi.14(2).2017.10.
Tumminello, M., Lillo, F., & Mantegna, R. N. (2010). Correlation, hierarchies, and networks in financial markets. Journal of Economic Behavior & Organization75(1), 40-58. https://doi.org/10.1016/j.jebo.2010.01.004
Zhou, T., Liu, J. G., Bai, W. J., Chen, G., & Wang, B. H. (2006). Behaviors of susceptible-infected epidemics on scale-free networks with identical infectivity. Physical Review E, 74(5), 56-109. https://doi.org/10.1103/PhysRevE.74.056109