Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7665677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:38:04+00:00 2026-05-31T14:38:04+00:00

Let’s say I have a large set of data within which each datum has

  • 0

Let’s say I have a large set of data within which each datum has several searchable columns (e.g. Color, Height, Width, etc) such that a user could issue searches like ‘all Red items’ or ‘all Green items with width under 50’.

Is there an established algorithm that would enable me to vary the sort order of a result set based on how many times a given item within the result set has already been returned for the same search criteria? I am looking for some sort of ‘fairness’ algorithm so that I can evenly distribute the frequency with which any given item in a result set is viewed early within that set. In other words, each item in the result set should have an equal probability of appearing as the first item in the result set.

Additionally for a given user/session, the sort order of the result set would have to be maintained such that paging, additional sorting, or further filtering within the set would first respect the algorithmic ‘fairness’ sort order, then apply any additional search filters.

I’ll be implementing this in an MVC.NET website with C# back-end and SQL 2008 database. Platform-specific solutions are of course welcome, but in general, I am wondering if there is an established algorithm. I also find that my vocabulary for describing the problem is limited, so any pointers for what I could even be searching the web for would be helpful.

In some sense, I am hoping to sort the items randomly each time they are queried only I would like to preserve that particular ‘randomness’ for the lifetime of that user’s session

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:38:06+00:00Added an answer on May 31, 2026 at 2:38 pm

    In some sense, I am hoping to sort the items randomly each time they are queried only I would like to preserve that particular ‘randomness’ for the lifetime of that user’s session

    Sounds like you could potentially generate a random seed on login (or session creation), store that in the user’s session, then create a new Random using that seed every time you shuffle the results. That’s likely to be the simplest way of doing it.

    On the other hand, it won’t preserve the order if the query results change. For example, if the values ABCDE end up as “ABDCE” then if the query is changed to exclude A, the same seed could easily give “BCED” as the shuffled version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have an Access database table that has 2 columns: one is
Let's say I'm building a data access layer for an application. Typically I have
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say that I have a set of relations that looks like this: relations
Let's say I have a dataset, which can be neatly classified using weka's J48
Let's say I have two assemblies: BusinessLogic and Web. BusinessLogic has an application setting
Let's say I have a Cat that has two properties: FavoriteKitten SecondFavoriteKitten These kittens
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>
Let's say I have a drive such as C:\ , and I want to
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.