Skip to main content

Finding the Kth Max Sum Pair in an Array of Distinct Elements Using Search Space Optimization

  • Conference paper
  • First Online:
Innovations in Computer Science and Engineering

Abstract

The algorithm aims to find the K\({\varvec{th}}\) max sum pair of two indices of an array of N (N \(\ge \) 2) distinct elements [a1, a2, a3, ..., an]. If the sum of values represented by the 2 indices of a single pair in array A is the same as that of any other pair, i.e., if P(ij) and P(mn) are 2 distinct pairs and if \({(\mathbf{A} [\textit{i}] + \mathbf{A} [\textit{j}] = \mathbf{A} [\textit{m}] + \mathbf{A} [\textit{n}]),}\) then the pair containing the index which represents the maximum of all 4 values represented by indices of the 2 pairs in the array obtains the highest priority, i.e., if \({(\mathbf{A} [\textit{m}] {>} \mathbf{A} [\textit{i}] {>} \mathbf{A} [\textit{n}] {>} \mathbf{A} [\textit{j}])}\), then the pair containing the index m obtains the highest priority. The purpose of this algorithm is to optimize the computation of recommendations on real time platforms. At the time of making a purchase on e-commerce platforms, with millions of options available in the product catalog, the algorithm can be used to recommend the best complementary product that can be bought as a pair with the main product or two all together different products of same type as of main product which can be bought as a combo or a pair. Not only the top recommendations, but random recommendations are also necessary so that the customers get a good breadth or variety of the available products in the catalog. In this paper, we propose an algorithm which can be used to address both the scenarios in real time and conclusively, it is evident that the time and space complexities are independent of K.

All the authors have an equal contribution towards work.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 219.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 279.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Sohail, S., et al.: Product recommendation techniques for ecommerce—past, present and future. Int. J. Adv. Res. Comput. Eng. Technol. 1(9), 219–225 (2012)

    Google Scholar 

  2. Gayle, L.: How Product Bundling Can Boost Your E-Commerce Sales. https://returnonnow.com/2018/08/how-product-bundling-boost-ecommerce/ (2018)

  3. Einav, Y.: Amazon Found Every 100ms of Latency Cost them 1% in Sales. https://www.gigaspaces.com/blog/amazon-found-every-100ms-of-latency-cost-them-1-in-sales (2019)

  4. Harmeling, C. et al.: How to Design Product Pages that Increase Online Sales. https://hbr.org/2019/11/how-to-design-product-pages-that-increase-online-sales

  5. Rousu, M., et al.: The effects of selling complements and substitutes on consumer willingness to pay: evidence from a laboratory experiment. Can. J. Agric. Econ. Revue canadienne d’agroeconomie. 56(2), 179–194 (2008)

    Article  Google Scholar 

  6. Ai, W., Yazdanifard, R.: The review of how sales promotion change the consumer’s perception and their purchasing behavior of a product. Glob. J. Manage. Bus. Res. E Mark. 15(5), 32–37 (2015)

    Google Scholar 

  7. Foubert, B.: Product Bundling: Theory and Application. University of Antwerp, Faculty of Applied Economics, Working Papers (1999)

    Google Scholar 

  8. Sharpe, K., Staelin, R.: Consumption effects of bundling: consumer perceptions, firm actions, and public policy implications. J. Pub. Policy Mark. 29(2), 170–188 (2010)

    Article  Google Scholar 

  9. Harris, J., Blair, E.: Consumer preference for product bundles: the role of reduced search costs. J. Acad. Mark. Sci. 34(4), 506–513 (2006)

    Article  Google Scholar 

  10. Schwartz, B.: The Paradox of Choice. Harper Perennial, New York (2004)

    Google Scholar 

  11. Gomez-Uribe, C., Hunt, N.: The netflix recommender system. ACM Trans. Manage. Inf. Syst. 6(4), 1–19 (2016)

    Article  Google Scholar 

  12. What the difference between global and random recommendations?. https://support.shippingeasy.com/hc/en-us/articles/115005400683-What-the-difference-between-global-and-random-recommendations

  13. Hopfgartner, F.: News recommendation in real-time. In: Smart Information Systems: Computational Intelligence for Real-Life Applications, pp. 169–170. Springer International Publishing (2015)

    Google Scholar 

  14. Zhao, Q., et al.: E-commerce recommendation with personalized promotion. In: Proceedings of the 9th ACM Conference on Recommender Systems—RecSys ’15, pp. 19–226 (2015)

    Google Scholar 

  15. Shanthi, R.: Customer Relationship Management. MJP Publisher (2019)

    Google Scholar 

  16. Linden, G., et al.: Collaborative Recommendations Using Item-to-Item Similarity Mappings (2020)

    Google Scholar 

  17. Agrawal, N., Sharma, S.: K maximum sum combinations from two arrays—GeeksforGeeks. https://www.geeksforgeeks.org/k-maximum-sum-combinations-two-arrays/

  18. Gangwar, A.: N Max Sum Pairs. https://discuss.codechef.com/t/n-max- sum-pairs/14769

  19. Liu, S.: N Max Pair Combinations. https://shengqianliu.me/heaps-and-maps/n- max-pair-combinations

  20. K maximum sum combinations from two arrays—Tutorialspoint.dev—TutorialsPoint.dev. https://tutorialspoint.dev/data-structure/heap-data-structure/k-maximum-sum-combinations-two-arrays

  21. Paul, G.: A complexity O(1) priority queue for event driven molecular dynamics simulations. J. Comput. Phys. 221(2), 615–625 (2007)

    Article  Google Scholar 

  22. Mirzaian, A., Arjomandi, E.: Selection in X + Y and matrices with sorted rows and columns. Inf. Process. Lett. 20(1), 13–17 (1985)

    Article  MathSciNet  Google Scholar 

  23. Mittal, N.: Find the Largest Pair Sum in an Unsorted Array—GeeksforGeeks. https://www.geeksforgeeks.org/find-the-largest-pair-sum-in-an-unsorted-array/

  24. Ojha, D.: Smallest Pair Sum in an array—GeeksforGeeks. https://www.geeksforgeeks.org/smallest-pair-sum-in-an-array/

  25. Mittal, N.: Count Pairs in a Sorted Array Whose Sum is Less than x—GeeksforGeeks. https://www.geeksforgeeks.org/count-pairs-array-whose-sum-less-x/

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Deepak Ahire .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Ahire, D., Bhandari, S., Kamble, K. (2021). Finding the Kth Max Sum Pair in an Array of Distinct Elements Using Search Space Optimization. In: Saini, H.S., Sayal, R., Govardhan, A., Buyya, R. (eds) Innovations in Computer Science and Engineering. Lecture Notes in Networks and Systems, vol 171. Springer, Singapore. https://doi.org/10.1007/978-981-33-4543-0_37

Download citation

Publish with us

Policies and ethics