Monday, 23 July 2012

Range from Minimum And Maximum Price


Product Range from Minimum and Maximum Price

Range From Minimum and Maximum Price
This algorithm is designed to find out a clean range of prices for several categories in any ecommerce website. Nowadays the products like mobile have ranges starting less than one thousand to let’s say 70,000. If user wants to see a range of products between a starting price and maximum upto some price then there should be a way by which we can provide a clean range . In this case the range should be something similar to

1. 1000-10000
2. 10000-25000
3. 25000-40000
4. 40000-70000

This gives a clean range taking care of the fact that the number of products in latter range would be less if we compare it with the initial range so the initial range is closely separated while the latter is sparsely separated so that it takes minimum tries for the user to get the product he was searching for.
Also as a lot of mobile accessories are sold by websites so this algorithm is all the more important if the accessories and mobiles are shown as 1 single search result .This is one such example , similarly we can see this for other categories as well.

Design of the Algorithm
For implementing this algorithm we started with several hit and trial methods untill we came with a clean range of numbers for providing the range.
Consider minimum price of a product = X
maximum price of a product = Y
Step -1 Round off the minimum X to the lower 100 value.
eg: 763 would be rounded of to 700
Step -2 Round off the maximum Y to the upper 100 or 1000 value.
eg: 8976 would be rounded of to 10000

Taking the above figures as examples we will be proceding to explain the steps

Step -3 Get the difference of the minimum and maximum rounded off numbers.
Here in this case we will get 10000-700=9300.

Step -4 Now as we need the earlier part of the range to be closely spaced and latter to be sparsely spaced we will use the weighted mean  so the difference will be divided by 10.
10 because we need to have 4 ranges total and for weighted range we use( 1 +2+3+4).
If we want 5 ranges in total what we can do is divide it by 15 as (1+2+3+4+5) and so on.
So the difference /10 = 9300/10=930

Step - 5 We will have 5 numbers from this as
Number1=Minimum = 700
Number2=Number1+1*difference = 700+1*930=1630
Number3= Number 2+2*difference = 1630+2*930=3490
Number4= Number 3+3*difference = 3490+3*930=6280
Number5=Number 4+4*difference = 6280+4*930=10000

So our ranges are  700-1630
      1630-3490
       3490-6280
      6280-10000


These ranges are not clean and looks very odd if we as a user get these to filter out our search results. To improve this we can have a range of values and for lower limit check for the lower limit from that list and for higher limit get the greater value from the list forming the clean range.

No comments:

Post a Comment