As the popularity of social networking sites continues to increase, spam accounts are also on the rise. Over the past few years, social networking and information-sharing microblogging websites such as Twitter and Sina Weibo have gained popularity. Unsolicited content, such as social spam, has also been exploited by spammers to overwhelm most users unfairly. In contrast to existing work, this paper uses a novel graph-based approach for spam detection. The problem of graph summarization has practical applications involving visualization and graph compression. As graph-structured databases become popular and prominent, summarizing and compressing graph-structured databases can become more and more valuable. Our experimental results demonstrate the usefulness and efficiency of our proposed strategy. The accuracy of the graph is considered before and after Graph Summarization using MultiNominal NB and then compared with other machine learning algorithms. Various algorithms are considered, and it is found that MultiNominal NB gives the lowest training time and the highest accuracy. The training time of MultiNominal NB is found to be 0.55 sec before graph summarization. After graph summarization, the training time is optimized to be 0.02 seconds, and the accuracy value is 96.64%.