Design of an Intelligent System for Optimal Discount Allocation in E-commerce Based on Customer Purchase Behavior

Document Type : Original Article

Authors

1 PhD in IT Engineering, Department of Information Technology Engineering (E-commerce) ,Qom university, Qom, Iran.

2 Department of Information Technology Engineering (E-commerce) ,Qom university, Qom, Iran.

3 Department of Statistics, Faculty of Statistics, Mathematics and Computer Science, Allameh Tabataba'i University, Tehran, Iran.

4 Department of Information Technology Engineering (E-commerce), K.N. Toosi University of Technology, Tehran, Iran.

10.22091/jdaid.2026.16144.1071

Abstract

This study presents an intelligent, data-driven framework to optimize discount allocation strategies within e-commerce environments. Rather than deploying standard uniform promotional tactics, this research proposes a prescriptive model that segments customers based on transaction history to maximize aggregate profitability and mitigate high-value customer attrition.Utilizing an empirical transaction dataset containing 4,570 validated purchase records from 1,000 unique customers, we calculate Recency, Frequency, and Monetary (RFM) vectors. Following min-max normalization, K-means clustering partitions the customer base. The optimal cluster structure (K=4) is formally validated using the Silhouette Coefficient (S) and the Davies-Bouldin Index (DB) alongside the traditional elbow method. We then formulate a constrained non-linear optimization model utilizing a logistic customer response function to analytically derive segment-specific discount rates that maximize expected net profit under a fixed marketing budget constraint. The empirical system identified four distinct customer archetypes: loyal high-value, at-risk, recent low-frequency, and inactive low-value customers. Compared to a baseline uniform 10 percent discount policy, the proposed optimized framework increased total profit from $184,965.74 to $197,556.92, representing an 8.7 percent improvement. Net profit margins expanded from 21.8 percent to 23.4 percent.Concurrently, high-value customer churn decreased by 12.3 percentage points, a reduction proven statistically significant via McNemar's test (p < 0.001), while promotional waste in low-value segments was entirely eliminated.These findings demonstrate that integrating behavioral clustering with constrained optimization structures yields significantly higher economic returns and customer retention compared to uniform pricing approaches. The proposed system is highly interpretable, computationally efficient, and directly applicable for deployment within small-to-medium enterprise (SME) e-commerce platforms.

Keywords

Main Subjects


Anitha, P., & Patil, M. M. (2022). RFM model for customer purchase behavior using K Means algorithm. Journal of King Saud University: Computer and Information Sciences, 34(5), 1785–1792. https://doi.org/10.1016/j.jksuci.2019.12.011
Athey, S., & Imbens, G. (2016). Recursive partitioning for heterogeneous causal effects. Proceedings of the National Academy of Sciences, 113(27), 7353–7360. https://doi.org/10.1073/pnas.1510489113
Awaliyah, D. A., Prasetiyo, B., Muzayanah, R., & Lestari, A. D. (2024). Optimizing customer segmentation in online retail transactions through the implementation of the K-means clustering algorithm. Scientific Journal of Informatics, 11(2). https://doi.org/10.15294/sji.v11i2.6137
Chehreh, S., & Sarabadani, A. (2024). A model based on random forest algorithm and Jaya optimization to predict bank customer churn. Journal of Engineering Management and Soft Computing, 9(2), 132–148. https://doi.org/10.22091/jemsc.2024.9541.1174
Chen, D., Sain, S. L., & Guo, K. (2012). Data mining for the online retail industry: A case study of RFM model-based customer segmentation using data mining. Journal of Database Marketing & Customer Strategy Management, 19(3), 197–208. https://doi.org/10.1057/dbm.2012.17
Fayyad, U., Piatetsky-Shapiro, G., & Smyth, P. (1996). From data mining to knowledge discovery in databases. AI Magazine, 17(3), 37–54. https://doi.org/10.1609/aimag.v17i3.1230
Han, J., Kamber, M., & Pei, J. (2022). Data mining: Concepts and techniques (4th ed.). Morgan Kaufmann.
Imanuel, D. A., & Alfian, G. (2025). Visualisasi segmentasi pelanggan berdasarkan atribut RFM menggunakan algoritma K-means untuk memahami karakteristik pelanggan pada toko retail online. Jurnal Teknologi Informasi dan Ilmu Komputer, 12(5). https://doi.org/10.25126/jtiik.2025128619
John, J. M., Shobayo, O., & Ogunleye, B. (2024). An exploration of clustering algorithms for customer segmentation in the UK retail market. arXiv. https://arxiv.org/abs/2402.04103
Johnson, J., Tellis, G. J., & Ip, E. H. (2013). To whom, when, and how much to discount? A constrained optimization of customized temporal discounts. Journal of Retailing, 89(4), 361–373. https://doi.org/10.1016/j.jretai.2013.08.002
Lemmens, A., & Gupta, S. (2020). Managing churn to maximize profits. Marketing Science, 39(5), 956–973. https://doi.org/10.1287/mksc.2020.1229
MacQueen, J. (1967). Some methods for classification and analysis of multivariate observations. In L. M. Le Cam & J. Neyman (Eds.), In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability (Vol. 1, pp. 281–297). University of California Press.
Miglautsch, J. R. (2000). Thoughts on RFM scoring. Journal of Database Marketing & Customer Strategy Management, 8(1), 67-72. https://doi.org/10.1057/palgrave.jdm.3240019
Ozcan, T. (2026). Customer segmentation using an extended RFM model and clustering algorithms in e-commerce. Journal of Theoretical and Applied Electronic Commerce Research, 21(5), 142. https://doi.org/10.3390/jtaer21050142
Salim, B. A., & Messaoud, C. (2026). Data-driven customer segmentation using the RFM model and K-means clustering: A longitudinal analytical study of online retail behavior using Python and Orange3. Science Education and Innovations in the Context of Modern Problems, 9(5). https://doi.org/10.56334/sei/9.5.17
Sarabada
Anitha, P., & Patil, M. M. (2022). RFM model for customer purchase behavior using K Means algorithm. Journal of King Saud University: Computer and Information Sciences, 34(5), 1785–1792. https://doi.org/10.1016/j.jksuci.2019.12.011
Athey, S., & Imbens, G. (2016). Recursive partitioning for heterogeneous causal effects. Proceedings of the National Academy of Sciences, 113(27), 7353–7360. https://doi.org/10.1073/pnas.1510489113
Awaliyah, D. A., Prasetiyo, B., Muzayanah, R., & Lestari, A. D. (2024). Optimizing customer segmentation in online retail transactions through the implementation of the K-means clustering algorithm. Scientific Journal of Informatics, 11(2). https://doi.org/10.15294/sji.v11i2.6137
Chehreh, S., & Sarabadani, A. (2024). A model based on random forest algorithm and Jaya optimization to predict bank customer churn. Journal of Engineering Management and Soft Computing, 9(2), 132–148. https://doi.org/10.22091/jemsc.2024.9541.1174
Chen, D., Sain, S. L., & Guo, K. (2012). Data mining for the online retail industry: A case study of RFM model-based customer segmentation using data mining. Journal of Database Marketing & Customer Strategy Management, 19(3), 197–208. https://doi.org/10.1057/dbm.2012.17
Fayyad, U., Piatetsky-Shapiro, G., & Smyth, P. (1996). From data mining to knowledge discovery in databases. AI Magazine, 17(3), 37–54. https://doi.org/10.1609/aimag.v17i3.1230
Han, J., Kamber, M., & Pei, J. (2022). Data mining: Concepts and techniques (4th ed.). Morgan Kaufmann.
Imanuel, D. A., & Alfian, G. (2025). Visualisasi segmentasi pelanggan berdasarkan atribut RFM menggunakan algoritma K-means untuk memahami karakteristik pelanggan pada toko retail online. Jurnal Teknologi Informasi dan Ilmu Komputer, 12(5). https://doi.org/10.25126/jtiik.2025128619
John, J. M., Shobayo, O., & Ogunleye, B. (2024). An exploration of clustering algorithms for customer segmentation in the UK retail market. arXiv. https://arxiv.org/abs/2402.04103
Johnson, J., Tellis, G. J., & Ip, E. H. (2013). To whom, when, and how much to discount? A constrained optimization of customized temporal discounts. Journal of Retailing, 89(4), 361–373. https://doi.org/10.1016/j.jretai.2013.08.002
Lemmens, A., & Gupta, S. (2020). Managing churn to maximize profits. Marketing Science, 39(5), 956–973. https://doi.org/10.1287/mksc.2020.1229
MacQueen, J. (1967). Some methods for classification and analysis of multivariate observations. In L. M. Le Cam & J. Neyman (Eds.), In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability (Vol. 1, pp. 281–297). University of California Press.
Miglautsch, J. R. (2000). Thoughts on RFM scoring. Journal of Database Marketing & Customer Strategy Management, 8(1), 67-72. https://doi.org/10.1057/palgrave.jdm.3240019
Ozcan, T. (2026). Customer segmentation using an extended RFM model and clustering algorithms in e-commerce. Journal of Theoretical and Applied Electronic Commerce Research, 21(5), 142. https://doi.org/10.3390/jtaer21050142
Salim, B. A., & Messaoud, C. (2026). Data-driven customer segmentation using the RFM model and K-means clustering: A longitudinal analytical study of online retail behavior using Python and Orange3. Science Education and Innovations in the Context of Modern Problems, 9(5). https://doi.org/10.56334/sei/9.5.17
Sarabadani, A., Saffarie, M., & RahseparFard, K. (2023). A framework for automating e-government services based on artificial intelligence. Journal of Engineering Management and Soft Computing, 9(2), 106-118. https://doi.org/10.22091/jemsc.2024.9256.1171
Wager, S., & Athey, S. (2018). Estimation and inference of heterogeneous treatment effects using random forests. Journal of the American Statistical Association, 113(523), 1228-1242. https://doi.org/10.1080/01621459.2017.1319839
Jafari, M., Akbari, A. H., & Akhavan, P. (2026). Leveraging Generative AI to Drive Supply Chain Resilience and Sustainable Performance: A Mediation Framework for Next-Generation Supply Chains. Technology in Society, 103444. doi: 10.1016/j.techsoc.2026.103444
Jafari, M., Akhavan, P., & Akbari, A. H. (2026). A Data-Driven Multi-Objective optimization framework for dynamic job shop scheduling with order Acceptance, inventory and Energy-Aware decisions. Computers & Industrial Engineering, 111886. doi: 10.1016/j.cie.2026.111886
Jafari, M., & Akbari, A. H. (2026). Deep reinforcement learning for dynamic cellular manufacturing systems with deterioration effect. International Journal of Computing Science and Mathematics, 23(1), 39-80. https://doi.org/10.1504/IJCSM.2026.151974
Jafari, M., & Akbari, A. H. (2026). Efficient algorithms for cellular manufacturing systems with deterioration effect and inventory (case study: stone paper factory). International Journal of Industrial and Systems Engineering, 52(3), 345-383. https://doi.org/10.1504/IJISE.2026.152157
Jafari, M., Akhavan, P., & Akbari, A. H. (2026). Enhancing supply chain agility and performance through big data analytics: the role of digitalization and top management support. International Journal of Productivity and Performance Management, 1-22. https://doi.org/10.1108/IJPPM-06-2025-0557
ni, A., Saffarie, M., & RahseparFard, K. (2023). A framework for automating e-government services based on artificial intelligence. Journal of Engineering Management and Soft Computing, 9(2), 106-118. https://doi.org/10.22091/jemsc.2024.9256.1171
Wager, S., & Athey, S. (2018). Estimation and inference of heterogeneous treatment effects using random forests. Journal of the American Statistical Association, 113(523), 1228-1242. https://doi.org/10.1080/01621459.2017.1319839
Esmaeili, F., & Marjani, M. R. (2026). The integrated problem of locating, allocating, and routing transportation vehicles in the blood product supply chain during crisis conditions. Journal of Engineering Management and Soft Computing, 12(3), 1-19. doi: 10.22091/jemsc.2026.12252.1254
Mousavi, S. T., Faezy Razi, F., & Danaei, A. (2026). Co-EvoDT: Design of a Co-evolving Digital Twin Framework for Media Digital Transformation in the Metaverse through Integration of Multi-Agent Reinforcement Learning and LSTM-based Sequential Forecasting. Journal of Engineering Management and Soft Computing, 12(3), 39-61. doi: 10.22091/jemsc.2026.14030.1306
Akhshabi, M., & Arab, J. (2026). Designing a multi-objective mathematical model for optimizing a shop floor flow production system, considering the number of human activities using the Gray Wolf metaheuristic algorithm. Journal of Engineering Management and Soft Computing, 12(2), 1-18. doi: 10.22091/jemsc.2026.12210.1253
Molaei, M., Moradi-Kamali, H., & Entezari-Maleki, R. (2026). Forecasting Stock Market Volatility: A Wavelet-Enhanced Hybrid GARCH-Deep Learning Approach. Journal of Engineering Management and Soft Computing, 12(2), 56-74. doi: 10.22091/jemsc.2026.13545.1291
Banaei, S. M., Roozbahani, M. H., & Sohofi, A. (2026). Bridging the Gap in Fetal Heart Rate Monitoring: Introduction and Evaluation of an Acoustic-Based Smart Belt for Real-Time, Passive, Mother-Centered Monitoring with Extensive Multicenter Validation. Journal of Engineering Management and Soft Computing, 12(1), 1-13. doi: 10.22091/jemsc.2026.15145.1340
Sayyah, A. (2026). Identification and Evaluation of Deep Learning-Based Defense Strategies to Counter DDoS Attacks in Cloud Computing Environments. Journal of Engineering Management and Soft Computing, 12(1), 36-48. doi: 10.22091/jemsc.2026.14316.1317
Yousefi Nejad, M., Farajian, K., & Jaleb, H. (2025). Analysis of factors affecting the length of stay of patients using clustering and association rules (Case study: Amir al-Momenin Hospital, Maragheh). Journal of Engineering Management and Soft Computing, 11(2), 1-20. doi: 10.22091/jemsc.2025.11174.1195
Hosseini, S. J., Mohaghar, A., Mokhtari, G., & Maleki, M. H. (2025). Modeling the Combined Problem of Determining the Lot Sizing and Cutting Stock of Raw Materials and Solving With Deep Reinforcement Learning and Exact Method. Journal of Engineering Management and Soft Computing, 11(2), 326-347. doi: 10.22091/jemsc.2025.14699.1328
Abdolhossein Zadeh, S., Zandieh, M., & Alam-Tabriz, A. (2025). E-Healthcare Improvement through the Design of a Cloud-Based Blood Supply Chain: A System Dynamics Approach. Journal of Engineering Management and Soft Computing, 11(1), 47-1. doi: 10.22091/jemsc.2025.11210.1201
Mahdian, M., & Matinkhah, S. M. (2025). Enhancing Service Recommendations in the Social Internet of Things: An Adaptive Collaborative Filtering Approach Using Friendship-Based Similarity. Journal of Engineering Management and Soft Computing, 11(1), 114-82. doi: 10.22091/jemsc.2025.11431.1210
Jafari, M., & Akbari, A. H. (2025). Development of a Deep Reinforcement Learning Algorithm in a Dynamic Cellular Manufacturing System Considering Order Rejection, Case Study: Stone Paper Factory. Journal of Engineering Management and Soft Computing, 10(2), 204-222. doi: 10.22091/jemsc.2025.11853.1230
Izadi, E., Nikbakht, M., Feylizadeh, M., & Shahin, A. (2025). Ranking of criteria affecting humanitarian supply chain services based on blockchain platforms using multi-criteria decision-making methods. Journal of Engineering Management and Soft Computing, 10(2), 143-160. doi: 10.22091/jemsc.2025.11552.1215
Dehghan, R., Naderan, M., & Alavi, S. E. (2024). Combining Convolutional Neural Network (CNN) and Grad-CAM for Parkinson’s Disease Prediction and Visual Explanation. Journal of Engineering Management and Soft Computing, 10(1), 1-13. doi: 10.22091/jemsc.2024.10828.1180
Abolghasemian, M., Bigdeli, H., & Shamami, N. (2024). Locating Routing Problem (LRP) of distribution of priority support items to ground forces in war conditions. Journal of Engineering Management and Soft Computing, 10(1), 262-292. doi: 10.22091/jemsc.2024.11320.1206