## 1 Introduction  
The proliferation of the digital realm has given rise to a myriad of opportunities and advancements in various domains. However, this rapid expansion has also led to an increased vulnerability to cyber threats, making network security a critical concern in today's interconnected world. Among the numerous cyber attacks, portscan attacks have garnered significant attention, as they pose a considerable risk to the integrity of both internal and external networks. Accurately identifying and classifying these attacks is of paramount importance in order to bolster our defenses against the evolving landscape of cyber threats.  
In recent years, machine learning has emerged as a powerful tool for addressing complex classification problems in various fields, including network security. Several machine learning models have been employed to distinguish between normal and attack instances in network data. However, the quest for more accurate and efficient classification techniques remains ongoing.  
This study presents an innovative approach to enhance the classification performance of machine learning models by integrating graph theory with network data analysis. Byconverting the network data into graph-based representations, we aim to uncover previously inaccessible insights and patterns, thereby improving the discriminative capabilities of machine learning algorithms.  
Our primary contributions in this work are as follows:  
* We demonstrate the application of graph theory to network data, specifically focusing on port scan attacks both inside and outside networks.
* We provide a comprehensive experimental analysis, encompassing data preprocessing, visualization, feature analysis, and machine learning model comparison, to assess the efficacy of graph theory representation in improving classification performance.
* We highlight the modest yet meaningful improvement in accuracy achieved by incorporating graph theory representation in the analysis of network data.  
This work not only represents a significant stride towards more robust and adaptive network security solutions, but also paves the way for future research endeavors to delve deeper into the intricate interplay between graph theory and network data analysis. By unearthing novel insights and refining classification processes, we move closer to the ultimate goal of creating a more secure and resilient digital landscape in the face of relentless cyber threats.  
The remainder of this paper is organized as follows: Section 2 delves into the related work, providing an overview of the existing research and techniques employed in the domain of network security and machine learning. Section 3 presents our proposed approach, detailing the integration of graph theory with machine learning models to enhance classification performance. In Section 4, we elaborate on the graph theory representation, outlining the methodology employed for converting network data into graph-based representations. Section 5 describes the data used in this study, including its source, characteristics, and preprocessing steps. Section 6 delves into the experiments and results, illustrating the efficacy of our approach in improving the classification performance of machine learning models. Finally, Section 7 concludes the paper, summarizing our findings and outlining potential avenues for future research.